summaryrefslogtreecommitdiffstats
path: root/src/storage/chewing_large_table2.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-03-18 11:16:35 +0800
committerPeng Wu <alexepico@gmail.com>2016-03-18 11:16:35 +0800
commit8d70d901d992d1b96e69cda401d9880d442816c6 (patch)
treeb86bb63daa49f4f612cb4f171979a0b508566764 /src/storage/chewing_large_table2.h
parent2ad795e5832bf730cbdd5c2aacd4c2a4e94806bd (diff)
downloadlibpinyin-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.h6
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();