diff options
author | Peng Wu <alexepico@gmail.com> | 2017-05-11 17:24:55 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2017-05-11 17:24:55 +0800 |
commit | dcd10dd3958db7aedaf8e746e4657669ce8fb75d (patch) | |
tree | 8a6adaa18c4c76e357e7130902a2c71c28a0b128 | |
parent | 3a3b0ff675a03c8af84fb0062e744084ecf6a6c6 (diff) | |
download | libpinyin-dcd10dd3958db7aedaf8e746e4657669ce8fb75d.tar.gz libpinyin-dcd10dd3958db7aedaf8e746e4657669ce8fb75d.tar.xz libpinyin-dcd10dd3958db7aedaf8e746e4657669ce8fb75d.zip |
support zhuyin table in table_info.cpp
-rw-r--r-- | src/include/novel_types.h | 1 | ||||
-rw-r--r-- | src/storage/table_info.cpp | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/include/novel_types.h b/src/include/novel_types.h index d9d9e65..15c8656 100644 --- a/src/include/novel_types.h +++ b/src/include/novel_types.h @@ -152,6 +152,7 @@ typedef enum { /* for default tables. */ RESERVED = 0, GB_DICTIONARY = 1, + TSI_DICTIONARY = 1, GBK_DICTIONARY = 2, OPENGRAM_DICTIONARY = 3, MERGED_DICTIONARY = 4, diff --git a/src/storage/table_info.cpp b/src/storage/table_info.cpp index 51f34c8..4cfc842 100644 --- a/src/storage/table_info.cpp +++ b/src/storage/table_info.cpp @@ -129,6 +129,7 @@ static TABLE_TARGET to_table_target(const char * str) { static guint8 to_index_of_default_tables(const char * str) { HANDLE(RESERVED); HANDLE(GB_DICTIONARY); + HANDLE(TSI_DICTIONARY); HANDLE(GBK_DICTIONARY); HANDLE(OPENGRAM_DICTIONARY); HANDLE(MERGED_DICTIONARY); @@ -207,8 +208,8 @@ bool SystemTableInfo2::load(const char * filename) { m_model_data_version = modelver; m_lambda = lambda; - /* Note: only support pinyin table now. */ - assert(PINYIN_TABLE == type); + /* Note: only support pinyin or zhuyin table now. */ + assert(PINYIN_TABLE == type || ZHUYIN_TABLE == type); m_table_phonetic_type = type; int index = 0; @@ -268,6 +269,10 @@ gfloat SystemTableInfo2::get_lambda() { return m_lambda; } +TABLE_PHONETIC_TYPE SystemTableInfo2::get_table_phonetic_type() { + return m_table_phonetic_type; +} + UserTableInfo::UserTableInfo() { m_binary_format_version = 0; |