diff options
author | Peng Wu <alexepico@gmail.com> | 2013-08-16 11:17:16 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2013-08-16 11:17:16 +0800 |
commit | bc486c181bfa92773739370d22c0762b66a62f91 (patch) | |
tree | 3b3406f6c28af68cdace25980effcb390ba570dd | |
parent | 894ad4b7e21e908c319c675b2d6a5fcdc23d9776 (diff) | |
download | libzhuyin-bc486c181bfa92773739370d22c0762b66a62f91.tar.gz libzhuyin-bc486c181bfa92773739370d22c0762b66a62f91.tar.xz libzhuyin-bc486c181bfa92773739370d22c0762b66a62f91.zip |
use secondary bopomofo instead of second bopomofo
-rw-r--r-- | scripts/bopomofo.py | 2 | ||||
-rw-r--r-- | scripts/genpinyinheader.py | 6 | ||||
-rw-r--r-- | scripts/genpinyintable.py | 22 | ||||
-rw-r--r-- | scripts/pinyin_parser_table.h.in | 4 | ||||
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 4 |
5 files changed, 19 insertions, 19 deletions
diff --git a/scripts/bopomofo.py b/scripts/bopomofo.py index 0671b17..349f494 100644 --- a/scripts/bopomofo.py +++ b/scripts/bopomofo.py @@ -941,7 +941,7 @@ BOPOMOFO_LUOMA_PINYIN_MAP = { } -BOPOMOFO_SECOND_BOPOMOFO_MAP = { +BOPOMOFO_SECONDARY_BOPOMOFO_MAP = { "ㄅㄚ" : "ba", "ㄅㄛ" : "bo", "ㄅㄞ" : "bai", diff --git a/scripts/genpinyinheader.py b/scripts/genpinyinheader.py index 9582a1c..4f1a1b8 100644 --- a/scripts/genpinyinheader.py +++ b/scripts/genpinyinheader.py @@ -23,7 +23,7 @@ from utils import expand_file from genpinyintable import gen_content_table, \ gen_hanyu_pinyin_index, gen_luoma_pinyin_index, \ - gen_bopomofo_index, gen_second_bopomofo_index, \ + gen_bopomofo_index, gen_secondary_bopomofo_index, \ gen_chewing_key_table def get_table_content(tablename): @@ -35,8 +35,8 @@ def get_table_content(tablename): return gen_luoma_pinyin_index() if tablename == 'BOPOMOFO_INDEX': return gen_bopomofo_index() - if tablename == 'SECOND_BOPOMOFO_INDEX': - return gen_second_bopomofo_index() + if tablename == 'SECONDARY_BOPOMOFO_INDEX': + return gen_secondary_bopomofo_index() if tablename == 'DIVIDED_TABLE': return '' if tablename == 'RESPLIT_TABLE': diff --git a/scripts/genpinyintable.py b/scripts/genpinyintable.py index b9f46df..27b047f 100644 --- a/scripts/genpinyintable.py +++ b/scripts/genpinyintable.py @@ -20,7 +20,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import operator -from bopomofo import BOPOMOFO_HANYU_PINYIN_MAP, BOPOMOFO_LUOMA_PINYIN_MAP, BOPOMOFO_SECOND_BOPOMOFO_MAP +from bopomofo import BOPOMOFO_HANYU_PINYIN_MAP, BOPOMOFO_LUOMA_PINYIN_MAP, BOPOMOFO_SECONDARY_BOPOMOFO_MAP from pinyintable import * from chewingkey import gen_table_index @@ -29,7 +29,7 @@ content_table = [] hanyu_pinyin_index = [] luoma_pinyin_index = [] bopomofo_index = [] -second_bopomofo_index = [] +secondary_bopomofo_index = [] #pinyin table @@ -40,8 +40,8 @@ def filter_pinyin_list(): if bopomofo in BOPOMOFO_LUOMA_PINYIN_MAP: luoma = BOPOMOFO_LUOMA_PINYIN_MAP[bopomofo] - if bopomofo in BOPOMOFO_SECOND_BOPOMOFO_MAP: - second = BOPOMOFO_SECOND_BOPOMOFO_MAP[bopomofo] + if bopomofo in BOPOMOFO_SECONDARY_BOPOMOFO_MAP: + second = BOPOMOFO_SECONDARY_BOPOMOFO_MAP[bopomofo] flags = '|'.join(flags) chewing = "ChewingKey({0})".format(', '.join(chewing)) @@ -56,19 +56,19 @@ def filter_pinyin_list(): if "IS_BOPOMOFO" in flags: bopomofo_index.append((bopomofo, flags)) if second: - second_bopomofo_index.append((second, "IS_PINYIN")) + secondary_bopomofo_index.append((second, "IS_PINYIN")) def sort_all(): global content_table, hanyu_pinyin_index, luoma_pinyin_index - global bopomofo_index, second_bopomofo_index + global bopomofo_index, secondary_bopomofo_index #remove duplicates content_table = list(set(content_table)) hanyu_pinyin_index = list(set(hanyu_pinyin_index)) luoma_pinyin_index = list(set(luoma_pinyin_index)) bopomofo_index = list(set(bopomofo_index)) - second_bopomofo_index = list(set(second_bopomofo_index)) + secondary_bopomofo_index = list(set(secondary_bopomofo_index)) #define sort function sortfunc = operator.itemgetter(0) @@ -80,7 +80,7 @@ def sort_all(): hanyu_pinyin_index = sorted(hanyu_pinyin_index, key=sortfunc) luoma_pinyin_index = sorted(luoma_pinyin_index, key=sortfunc) bopomofo_index = sorted(bopomofo_index, key=sortfunc) - second_bopomofo_index = sorted(second_bopomofo_index, key=sortfunc) + secondary_bopomofo_index = sorted(secondary_bopomofo_index, key=sortfunc) ''' def get_sheng_yun(pinyin): @@ -130,9 +130,9 @@ def gen_bopomofo_index(): entries.append(entry) return ',\n'.join(entries) -def gen_second_bopomofo_index(): +def gen_secondary_bopomofo_index(): entries = [] - for (bopomofo, flags) in second_bopomofo_index: + for (bopomofo, flags) in secondary_bopomofo_index: index = [x[3] for x in content_table].index(bopomofo) entry = '{{"{0}", {1}, {2}}}'.format(bopomofo, flags, index) entries.append(entry) @@ -150,6 +150,6 @@ sort_all() ### main function ### if __name__ == "__main__": #s = gen_content_table() + gen_hanyu_pinyin_index() + gen_bopomofo_index() - s = gen_content_table() + gen_luoma_pinyin_index() + gen_second_bopomofo_index() + s = gen_content_table() + gen_luoma_pinyin_index() + gen_secondary_bopomofo_index() #s = gen_chewing_key_table() print(s) diff --git a/scripts/pinyin_parser_table.h.in b/scripts/pinyin_parser_table.h.in index 2954b0b..a722dab 100644 --- a/scripts/pinyin_parser_table.h.in +++ b/scripts/pinyin_parser_table.h.in @@ -15,8 +15,8 @@ const chewing_index_item_t bopomofo_index[] = { @BOPOMOFO_INDEX@ }; -const pinyin_index_item_t second_bopomofo_index[] = { -@SECOND_BOPOMOFO_INDEX@ +const pinyin_index_item_t secondary_bopomofo_index[] = { +@SECONDARY_BOPOMOFO_INDEX@ }; const content_table_item_t content_table[] = { diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index adec727..f3ec9fa 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -421,8 +421,8 @@ bool FullPinyinParser2::set_scheme(PinyinScheme scheme){ m_pinyin_index_len = G_N_ELEMENTS(luoma_pinyin_index); break; case PINYIN_SECONDARY_BOPOMOFO: - m_pinyin_index = second_bopomofo_index; - m_pinyin_index_len = G_N_ELEMENTS(second_bopomofo_index); + m_pinyin_index = secondary_bopomofo_index; + m_pinyin_index_len = G_N_ELEMENTS(secondary_bopomofo_index); break; default: assert(false); |