From a2839e6a76eeeb49a8f5b0218548b8aa3bc136ad Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 21 Nov 2011 14:01:47 +0800 Subject: begin to write double pinyin parser2 --- src/storage/pinyin_parser2.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/storage/pinyin_parser2.cpp') 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; +} -- cgit