summaryrefslogtreecommitdiffstats
path: root/src/storage/pinyin_parser2.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-11-21 14:01:47 +0800
committerPeng Wu <alexepico@gmail.com>2011-11-21 14:01:47 +0800
commita2839e6a76eeeb49a8f5b0218548b8aa3bc136ad (patch)
tree2d99f41b8ea9c53ee9987627d99a7f8c1101227d /src/storage/pinyin_parser2.cpp
parent4dba58edd6bb7698fbd38e5c146848cabcadad1b (diff)
downloadlibpinyin-a2839e6a76eeeb49a8f5b0218548b8aa3bc136ad.tar.gz
libpinyin-a2839e6a76eeeb49a8f5b0218548b8aa3bc136ad.tar.xz
libpinyin-a2839e6a76eeeb49a8f5b0218548b8aa3bc136ad.zip
begin to write double pinyin parser2
Diffstat (limited to 'src/storage/pinyin_parser2.cpp')
-rw-r--r--src/storage/pinyin_parser2.cpp26
1 files changed, 26 insertions, 0 deletions
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;
+}