write pinyin_parser_table.h.in
authorPeng Wu <alexepico@gmail.com>
Wed, 2 Nov 2011 04:07:02 +0000 (12:07 +0800)
committerPeng Wu <alexepico@gmail.com>
Wed, 2 Nov 2011 04:07:02 +0000 (12:07 +0800)
scripts/genspecialtable.py
scripts/pinyin_parser_table.h.in [new file with mode: 0644]

index 4315087..928ca9e 100644 (file)
@@ -71,7 +71,7 @@ def filter_divided():
         yield pinyin_key, first_key, second_key, freq
 
 
-def gen_all_special():
+def gen_all_resplit():
     for pinyin_key in pinyin_list:
         if pinyin_key[-1] in ["n", "g", "r"]:
             for yun in yunmu_list:
@@ -84,9 +84,9 @@ def gen_all_special():
             yield pinyin_key, "r", pinyin_key[:-1], "er"
 
 
-def filter_special():
+def filter_resplit():
     for (orig_first_key, orig_second_key, new_first_key, new_second_key) \
-    in gen_all_special():
+    in gen_all_resplit():
         if not (new_first_key, new_second_key) in phrase_dict:
             continue
         orig_freq = 0
@@ -101,5 +101,5 @@ if __name__ == "__main__":
     load_phrase("pinyin2.txt")
     for p in filter_divided():
         print (p)
-    for p in filter_special():
+    for p in filter_resplit():
         print (p)
diff --git a/scripts/pinyin_parser_table.h.in b/scripts/pinyin_parser_table.h.in
new file mode 100644 (file)
index 0000000..8bb7bb8
--- /dev/null
@@ -0,0 +1,17 @@
+/* This file is generated by python scripts. Don't edit this file directly.
+ */
+
+#ifndef PINYIN_PARSER_TABLE_H
+#define PINYIN_PARSER_TABLE_H
+
+@PINYIN_INDEX@
+
+@BOPOMOFO_INDEX@
+
+@CONTENT_TABLE@
+
+@DIVIDED_TABLE@
+
+@RESPLIT_TABLE@
+
+#endif