diff options
author | Peng Wu <alexepico@gmail.com> | 2012-02-10 16:53:11 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-02-10 16:53:11 +0800 |
commit | 76f09ca801360d7ba5413f34eefd581d0199aeba (patch) | |
tree | ee6cd532e1785cc272bb45b1dd9e6bde128210a6 /src | |
parent | 64e3ee153b152091983cf830d214bb20bfa44b46 (diff) | |
download | libpinyin-76f09ca801360d7ba5413f34eefd581d0199aeba.tar.gz libpinyin-76f09ca801360d7ba5413f34eefd581d0199aeba.tar.xz libpinyin-76f09ca801360d7ba5413f34eefd581d0199aeba.zip |
improves pinyin parsers
Diffstat (limited to 'src')
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 9 |
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; } } } |