diff options
author | Peng Wu <alexepico@gmail.com> | 2016-03-18 11:16:35 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2016-03-18 11:16:35 +0800 |
commit | 8d70d901d992d1b96e69cda401d9880d442816c6 (patch) | |
tree | b86bb63daa49f4f612cb4f171979a0b508566764 /src/storage/chewing_large_table2.h | |
parent | 2ad795e5832bf730cbdd5c2aacd4c2a4e94806bd (diff) | |
download | libpinyin-8d70d901d992d1b96e69cda401d9880d442816c6.tar.gz libpinyin-8d70d901d992d1b96e69cda401d9880d442816c6.tar.xz libpinyin-8d70d901d992d1b96e69cda401d9880d442816c6.zip |
fixes crashes
Diffstat (limited to 'src/storage/chewing_large_table2.h')
-rw-r--r-- | src/storage/chewing_large_table2.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/storage/chewing_large_table2.h b/src/storage/chewing_large_table2.h index 0aaddd1..52c5983 100644 --- a/src/storage/chewing_large_table2.h +++ b/src/storage/chewing_large_table2.h @@ -106,7 +106,11 @@ public: int search(/* in */ const ChewingKey keys[], /* out */ PhraseIndexRanges ranges) const { IndexItem item; - compute_chewing_index(keys, item.m_keys, phrase_length); + if (contains_incomplete_pinyin(keys, phrase_length)) { + compute_incomplete_chewing_index(keys, item.m_keys, phrase_length); + } else { + compute_chewing_index(keys, item.m_keys, phrase_length); + } const IndexItem * begin = (IndexItem *) m_chunk.begin(); const IndexItem * end = (IndexItem *) m_chunk.end(); |