From dcd10dd3958db7aedaf8e746e4657669ce8fb75d Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 11 May 2017 17:24:55 +0800 Subject: support zhuyin table in table_info.cpp --- src/include/novel_types.h | 1 + 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; -- cgit