diff options
author | Peng Wu <alexepico@gmail.com> | 2011-11-21 14:01:47 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-11-21 14:01:47 +0800 |
commit | a2839e6a76eeeb49a8f5b0218548b8aa3bc136ad (patch) | |
tree | 2d99f41b8ea9c53ee9987627d99a7f8c1101227d | |
parent | 4dba58edd6bb7698fbd38e5c146848cabcadad1b (diff) | |
download | libpinyin-a2839e6a76eeeb49a8f5b0218548b8aa3bc136ad.tar.gz libpinyin-a2839e6a76eeeb49a8f5b0218548b8aa3bc136ad.tar.xz libpinyin-a2839e6a76eeeb49a8f5b0218548b8aa3bc136ad.zip |
begin to write double pinyin parser2
-rw-r--r-- | scripts/double_pinyin_table.h.in | 3 | ||||
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 26 |
2 files changed, 29 insertions, 0 deletions
diff --git a/scripts/double_pinyin_table.h.in b/scripts/double_pinyin_table.h.in new file mode 100644 index 0000000..e2f3fff --- /dev/null +++ b/scripts/double_pinyin_table.h.in @@ -0,0 +1,3 @@ +/* This file is generated by python scripts. Don't edit this file directly. + */ + diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index 82141d4..ad4f05e 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -381,3 +381,29 @@ bool FullPinyinParser2::post_process(guint32 options, return true; } + + +bool DoublePinyinParser2::parse_one_key (guint32 options, ChewingKey & key, + ChewingKeyRest & key_rest, + const char *str, int len) const{ + if (1 == len) { + if (!(options & PINYIN_INCOMPLETE)) + return false; + assert(FALSE); + } + + options &= ~PINYIN_CORRECT_ALL; + + if (2 == len || 3 == len) { + /* parse shengmu and yunmu here. */ + assert(FALSE); + } + + if (3 == len) { + if (!(options & USE_TONE)) + return false; + assert(FALSE); + } + + return false; +} |