diff options
author | Peng Wu <alexepico@gmail.com> | 2016-05-26 11:57:41 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2016-05-26 11:57:41 +0800 |
commit | cba509e211af9432573362825ae66fa8eb41fdd5 (patch) | |
tree | 39a4dfc6ce11e2fc868f40fb3219671805f1bb3a /src/lookup | |
parent | 41b5974304689488f006d98155d782880a7e1670 (diff) | |
download | libpinyin-cba509e211af9432573362825ae66fa8eb41fdd5.tar.gz libpinyin-cba509e211af9432573362825ae66fa8eb41fdd5.tar.xz libpinyin-cba509e211af9432573362825ae66fa8eb41fdd5.zip |
fixes typos
Diffstat (limited to 'src/lookup')
-rw-r--r-- | src/lookup/pinyin_lookup2.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lookup/pinyin_lookup2.cpp b/src/lookup/pinyin_lookup2.cpp index 1c1ec23..f11756f 100644 --- a/src/lookup/pinyin_lookup2.cpp +++ b/src/lookup/pinyin_lookup2.cpp @@ -303,7 +303,8 @@ bool PinyinLookup2::search_unigram2(GPtrArray * topresults, &g_array_index(m_constraints, lookup_constraint_t, start); if (CONSTRAINT_ONESTEP == constraint->m_type) { - return unigram_gen_next_step(start, end, max, constraint->m_token); + return unigram_gen_next_step(start, constraint->m_end, + max, constraint->m_token); } bool found = false; @@ -359,7 +360,8 @@ bool PinyinLookup2::search_bigram2(GPtrArray * topresults, guint32 total_freq; m_merged_single_gram.get_total_freq(total_freq); gfloat bigram_poss = freq / (gfloat) total_freq; - found = bigram_gen_next_step(start, end, value, token, bigram_poss) || found; + found = bigram_gen_next_step(start, contraint->m_end, + value, token, bigram_poss) || found; } } @@ -490,7 +492,7 @@ bool PinyinLookup2::save_next_step(int next_step_pos, bool PinyinLookup2::final_step(MatchResults & results){ /* reset results */ - g_array_set_size(results, m_steps_content->len - 1); + g_array_set_size(results, m_steps_content->len); for (size_t i = 0; i < results->len; ++i){ phrase_token_t * token = &g_array_index(results, phrase_token_t, i); *token = null_token; |