From d894cf14145e54d934d0490aae80bfb8c7aafb79 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 2 Nov 2011 12:07:02 +0800 Subject: write pinyin_parser_table.h.in --- scripts/genspecialtable.py | 8 ++++---- scripts/pinyin_parser_table.h.in | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 scripts/pinyin_parser_table.h.in (limited to 'scripts') diff --git a/scripts/genspecialtable.py b/scripts/genspecialtable.py index 4315087..928ca9e 100644 --- a/scripts/genspecialtable.py +++ b/scripts/genspecialtable.py @@ -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 index 0000000..8bb7bb8 --- /dev/null +++ b/scripts/pinyin_parser_table.h.in @@ -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 -- cgit