summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-02-10 16:53:11 +0800
committerPeng Wu <alexepico@gmail.com>2012-02-10 16:53:11 +0800
commit76f09ca801360d7ba5413f34eefd581d0199aeba (patch)
treeee6cd532e1785cc272bb45b1dd9e6bde128210a6
parent64e3ee153b152091983cf830d214bb20bfa44b46 (diff)
downloadlibpinyin-76f09ca801360d7ba5413f34eefd581d0199aeba.tar.gz
libpinyin-76f09ca801360d7ba5413f34eefd581d0199aeba.tar.xz
libpinyin-76f09ca801360d7ba5413f34eefd581d0199aeba.zip
improves pinyin parsers
-rw-r--r--src/storage/pinyin_parser2.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
index 494daad..80a525b 100644
--- a/src/storage/pinyin_parser2.cpp
+++ b/src/storage/pinyin_parser2.cpp
@@ -397,6 +397,15 @@ int FullPinyinParser2::parse (pinyin_option_t options, ChewingKeyVector & keys,
nextstep->m_key.m_middle == CHEWING_ZERO_MIDDLE &&
nextstep->m_key.m_final == CHEWING_ZERO_FINAL))
*nextstep = value;
+
+ /* "zheyanga$" -> "zhe'yang'a$" */
+ if (value.m_parsed_len == len &&
+ (nextstep->m_key.m_initial != CHEWING_ZERO_INITIAL &&
+ nextstep->m_key.m_final == CHEWING_A) &&
+ (value.m_key.m_initial == CHEWING_ZERO_INITIAL &&
+ value.m_key.m_middle == CHEWING_ZERO_MIDDLE &&
+ value.m_key.m_final == CHEWING_A))
+ *nextstep = value;
}
}
}