begin to write double pinyin parser2
authorPeng Wu <alexepico@gmail.com>
Mon, 21 Nov 2011 06:01:47 +0000 (14:01 +0800)
committerPeng Wu <alexepico@gmail.com>
Mon, 21 Nov 2011 06:01:47 +0000 (14:01 +0800)
scripts/double_pinyin_table.h.in [new file with mode: 0644]
src/storage/pinyin_parser2.cpp

diff --git a/scripts/double_pinyin_table.h.in b/scripts/double_pinyin_table.h.in
new file mode 100644 (file)
index 0000000..e2f3fff
--- /dev/null
@@ -0,0 +1,3 @@
+/* This file is generated by python scripts. Don't edit this file directly.
+ */
+
index 82141d4..ad4f05e 100644 (file)
@@ -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;
+}