summaryrefslogtreecommitdiffstats
path: root/src/storage/pinyin_parser2.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-04-18 10:21:02 +0800
committerPeng Wu <alexepico@gmail.com>2012-04-18 10:21:02 +0800
commitfb7ec2e7bfe2599360dcf5c26a7664ef475476c1 (patch)
tree1f23b3fe1a920ba40ac0e7a316b595326f02339d /src/storage/pinyin_parser2.cpp
parent5fe339e560a0536f7de9ccdc06e6d2283ea6dfbd (diff)
downloadlibpinyin-fb7ec2e7bfe2599360dcf5c26a7664ef475476c1.tar.gz
libpinyin-fb7ec2e7bfe2599360dcf5c26a7664ef475476c1.tar.xz
libpinyin-fb7ec2e7bfe2599360dcf5c26a7664ef475476c1.zip
remove FullPinyinParser2::post_process
Diffstat (limited to 'src/storage/pinyin_parser2.cpp')
-rw-r--r--src/storage/pinyin_parser2.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
index 732598c..662ee1b 100644
--- a/src/storage/pinyin_parser2.cpp
+++ b/src/storage/pinyin_parser2.cpp
@@ -477,77 +477,6 @@ int FullPinyinParser2::final_step(size_t step_len, ChewingKeyVector & keys,
return parsed_len;
}
-#if 0
-
-bool FullPinyinParser2::post_process(pinyin_option_t options,
- ChewingKeyVector & keys,
- ChewingKeyRestVector & key_rests) const {
- int i;
- assert(keys->len == key_rests->len);
- gint16 num_keys = keys->len;
-
- ChewingKey * cur_key = NULL, * next_key = NULL;
- ChewingKeyRest * cur_rest = NULL, * next_rest = NULL;
- guint16 next_tone = CHEWING_ZERO_TONE;
-
- for (i = 0; i < num_keys - 1; ++i) {
- cur_rest = &g_array_index(key_rests, ChewingKeyRest, i);
- next_rest = &g_array_index(key_rests, ChewingKeyRest, i + 1);
-
- /* some "'" here */
- 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;
-
- if (options & USE_TONE) {
- next_tone = next_key->m_tone;
- next_key->m_tone = CHEWING_ZERO_TONE;
- }
-
- /* lookup re-split table */
- size_t k;
- const resplit_table_item_t * item = NULL;
- for (k = 0; k < G_N_ELEMENTS(resplit_table); ++k) {
- item = resplit_table + k;
- /* no ops */
- if (item->m_orig_freq >= item->m_new_freq)
- continue;
-
- /* use pinyin_exact_compare2 here. */
- if (0 == pinyin_exact_compare2(item->m_orig_keys,
- cur_key, 2))
- break;
-
- }
-
- /* find the match */
- if (k < G_N_ELEMENTS(resplit_table)) {
- /* do re-split */
- item = resplit_table + k;
- *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 ++;
- }
-
- /* save back tones */
- if (options & USE_TONE) {
- next_key->m_tone = next_tone;
- }
- }
-
- return true;
-}
-
-#endif
-
bool FullPinyinParser2::post_process2(pinyin_option_t options,
ChewingKeyVector & keys,
ChewingKeyRestVector & key_rests,