summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-08-31 17:56:12 +0800
committerPeng Wu <alexepico@gmail.com>2012-09-01 11:17:21 +0800
commit948b116c561584bf99aa332b714866640de929b0 (patch)
tree1ad1020ef7173d3628e32db73eaad0982ed285bf /src
parentea1c8d88ee73d012bb128122d4dc012921df49b6 (diff)
downloadlibpinyin-948b116c561584bf99aa332b714866640de929b0.tar.gz
libpinyin-948b116c561584bf99aa332b714866640de929b0.tar.xz
libpinyin-948b116c561584bf99aa332b714866640de929b0.zip
fixes PinyinLookup::search_unigram
Diffstat (limited to 'src')
-rw-r--r--src/lookup/pinyin_lookup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lookup/pinyin_lookup.cpp b/src/lookup/pinyin_lookup.cpp
index bdcfd0b..b2d4e86 100644
--- a/src/lookup/pinyin_lookup.cpp
+++ b/src/lookup/pinyin_lookup.cpp
@@ -175,8 +175,8 @@ bool PinyinLookup::search_unigram(IBranchIterator * iter, int nstep, int npinyin
bool found = false;
for ( size_t i = 1; i < m_table_cache->len && i <= MAX_PHRASE_LENGTH; ++i){
lookup_constraint_t * constraint = &g_array_index(m_constraints, lookup_constraint_t, nstep + i - 1);
- if ( constraint->m_type != NO_CONSTRAINT )
- continue;
+ if ( constraint->m_type == CONSTRAINT_NOSEARCH )
+ break;
PhraseIndexRanges * ranges = &g_array_index(m_table_cache,PhraseIndexRanges, i);
for ( size_t m = 0; m < PHRASE_INDEX_LIBRARY_COUNT; ++m){
GArray * array = (*ranges)[m];