diff options
author | Peng Wu <alexepico@gmail.com> | 2012-01-29 13:17:33 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-01-29 13:17:33 +0800 |
commit | e739e5c04929ee1d02505fb79102cd145b192572 (patch) | |
tree | e1ecd40513604e3257d3f9d6d676204ea1942efa /src | |
parent | 93e8e69073840600d701bdd37067cbbc0afa23a8 (diff) | |
download | libpinyin-e739e5c04929ee1d02505fb79102cd145b192572.tar.gz libpinyin-e739e5c04929ee1d02505fb79102cd145b192572.tar.xz libpinyin-e739e5c04929ee1d02505fb79102cd145b192572.zip |
fixes post process in full pinyin parser
Diffstat (limited to 'src')
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index 0437440..ab8330c 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -464,22 +464,20 @@ bool FullPinyinParser2::post_process(pinyin_option_t options, guint16 next_tone = CHEWING_ZERO_TONE; for (i = 0; i < num_keys - 1; ++i) { - cur_key = &g_array_index(keys, ChewingKey, i); - next_key = &g_array_index(keys, ChewingKey, i + 1); + cur_rest = &g_array_index(key_rests, ChewingKeyRest, i); + next_rest = &g_array_index(key_rests, ChewingKeyRest, i + 1); /* some "'" here */ - if (0 == cur_key->get_table_index()) - continue; - if (0 == next_key->get_table_index()) + if (cur_rest->m_raw_end != next_rest->m_raw_begin) continue; + cur_key = &g_array_index(keys, ChewingKey, i); + next_key = &g_array_index(keys, ChewingKey, i + 1); + /* some tone here */ if (CHEWING_ZERO_TONE != cur_key->m_tone) continue; - cur_rest = &g_array_index(key_rests, ChewingKeyRest, i); - next_rest = &g_array_index(key_rests, ChewingKeyRest, i + 1); - if (options & USE_TONE) { next_tone = next_key->m_tone; next_key->m_tone = CHEWING_ZERO_TONE; |