From cee5f04690465d99b05313add946beceed2a31f2 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 3 Jun 2016 11:27:06 +0800 Subject: update *_step functions --- src/storage/phonetic_key_matrix.cpp | 3 +++ src/storage/pinyin_parser2.cpp | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'src/storage') diff --git a/src/storage/phonetic_key_matrix.cpp b/src/storage/phonetic_key_matrix.cpp index 360a00a..72b3f81 100644 --- a/src/storage/phonetic_key_matrix.cpp +++ b/src/storage/phonetic_key_matrix.cpp @@ -75,6 +75,9 @@ bool fill_phonetic_key_matrix_from_chewing_keys(PhoneticKeyMatrix * matrix, bool fuzzy_syllable_step(pinyin_option_t options, PhoneticKeyMatrix * matrix) { + if (!(options & PINYIN_AMB_ALL)) + return false; + size_t length = matrix->size(); GArray * keys = g_array_new(TRUE, TRUE, sizeof(ChewingKey)); diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index e9b7051..b96f6d8 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -886,6 +886,9 @@ int PinyinDirectParser2::parse(pinyin_option_t options, /* need to use the pinyin_parser_table header. */ bool resplit_step(pinyin_option_t options, PhoneticKeyMatrix * matrix) { + if (!(options & USE_RESPLIT_TABLE)) + return false; + size_t length = matrix->size(); GArray * keys = g_array_new(TRUE, TRUE, sizeof(ChewingKey)); @@ -965,6 +968,9 @@ bool resplit_step(pinyin_option_t options, /* need to use the pinyin_parser_table header. */ bool inner_split_step(pinyin_option_t options, PhoneticKeyMatrix * matrix) { + if (!(options & USE_DIVIDED_TABLE)) + return false; + size_t length = matrix->size(); GArray * keys = g_array_new(TRUE, TRUE, sizeof(ChewingKey)); -- cgit