diff options
author | Peng Wu <alexepico@gmail.com> | 2011-11-17 18:28:45 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-11-17 18:30:40 +0800 |
commit | a36b1dbc6877b6df76ef2e86d0552e826c50b657 (patch) | |
tree | b606a78676f558074d40896b567e82f12937c73e /src/storage/pinyin_parser2.cpp | |
parent | 3bcf118aab782f221185099de58de460c5d03077 (diff) | |
download | libpinyin-a36b1dbc6877b6df76ef2e86d0552e826c50b657.tar.gz libpinyin-a36b1dbc6877b6df76ef2e86d0552e826c50b657.tar.xz libpinyin-a36b1dbc6877b6df76ef2e86d0552e826c50b657.zip |
update divided/resplit table
Diffstat (limited to 'src/storage/pinyin_parser2.cpp')
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index 5d2414d..c2f3d39 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -353,20 +353,18 @@ bool FullPinyinParser2::post_process(guint32 options, /* no ops */ if (item->m_orig_freq >= item->m_new_freq) continue; - /* TODO: refine code style here. */ -#if 0 - if (item->m_orig_first_key == *cur_key && - item->m_orig_second_key == *next_key) + + /* use pinyin_exact_compare2 here. */ + if (0 == pinyin_exact_compare2(item->m_orig_keys, + cur_key, 2)) break; -#endif - /* TODO: should use pinyin_exact_compare2 here. */ - assert(FALSE); + } if (k < G_N_ELEMENTS(resplit_table)) { /* do re-split */ item = resplit_table + k; - *cur_key = item->m_new_first_key; - *next_key = item->m_new_second_key; + *cur_key = item->m_new_keys[0]; + *next_key = item->m_new_keys[1]; /* assumes only moved one char in gen_all_resplit script. */ cur_rest->m_raw_end --; next_rest->m_raw_begin --; |