summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-11-04 13:34:01 +0800
committerPeng Wu <alexepico@gmail.com>2013-11-04 13:34:09 +0800
commit54eb9848d09b7d68b908258d07bbf36b7a47a20d (patch)
treef4254264073195a317a6883862c3e64f1bd1f5b5
parent1ba2f10f6af8120ef6ec3ad9887c50af7f151c40 (diff)
downloadlibzhuyin-54eb9848d09b7d68b908258d07bbf36b7a47a20d.tar.gz
libzhuyin-54eb9848d09b7d68b908258d07bbf36b7a47a20d.tar.xz
libzhuyin-54eb9848d09b7d68b908258d07bbf36b7a47a20d.zip
use chewing tsi.src
-rw-r--r--src/include/novel_types.h4
-rw-r--r--src/storage/chewing_large_table.cpp2
-rw-r--r--src/storage/phrase_index.cpp2
-rw-r--r--src/storage/table_info.cpp6
-rw-r--r--src/zhuyin.cpp9
5 files changed, 8 insertions, 15 deletions
diff --git a/src/include/novel_types.h b/src/include/novel_types.h
index edc904b..ff4c22a 100644
--- a/src/include/novel_types.h
+++ b/src/include/novel_types.h
@@ -144,9 +144,7 @@ typedef guint32 pinyin_option_t;
typedef enum {
RESERVED = 0,
- GB_DICTIONARY = 1,
- GBK_DICTIONARY = 2,
- MERGED_DICTIONARY = 3,
+ TSI_DICTIONARY = 1,
USER_DICTIONARY = 15
} PHRASE_INDEX_LIBRARIES;
diff --git a/src/storage/chewing_large_table.cpp b/src/storage/chewing_large_table.cpp
index aa74e0d..42c5204 100644
--- a/src/storage/chewing_large_table.cpp
+++ b/src/storage/chewing_large_table.cpp
@@ -679,7 +679,7 @@ bool ChewingLargeTable::load_text(FILE * infile) {
glong len = g_utf8_strlen(phrase, -1);
- FullPinyinParser2 parser;
+ ChewingDirectParser2 parser;
ChewingKeyVector keys;
ChewingKeyRestVector key_rests;
diff --git a/src/storage/phrase_index.cpp b/src/storage/phrase_index.cpp
index 7229084..cb04175 100644
--- a/src/storage/phrase_index.cpp
+++ b/src/storage/phrase_index.cpp
@@ -557,7 +557,7 @@ bool FacadePhraseIndex::load_text(guint8 phrase_index, FILE * infile){
}
pinyin_option_t options = USE_TONE;
- FullPinyinParser2 parser;
+ ChewingDirectParser2 parser;
ChewingKeyVector keys = g_array_new(FALSE, FALSE, sizeof(ChewingKey));
ChewingKeyRestVector key_rests =
g_array_new(FALSE, FALSE, sizeof(ChewingKeyRest));
diff --git a/src/storage/table_info.cpp b/src/storage/table_info.cpp
index 707dc9c..d79d7be 100644
--- a/src/storage/table_info.cpp
+++ b/src/storage/table_info.cpp
@@ -30,11 +30,7 @@ using namespace zhuyin;
static const pinyin_table_info_t reserved_tables[] = {
{RESERVED, NULL, NULL, NULL, NOT_USED},
- {GB_DICTIONARY, "gb_char.table", "gb_char.bin", "gb_char.dbin", SYSTEM_FILE},
- {GBK_DICTIONARY, "gbk_char.table", "gbk_char.bin", "gbk_char.dbin", SYSTEM_FILE},
-
- {MERGED_DICTIONARY, "merged.table", "merged.bin", "merged.dbin", SYSTEM_FILE},
-
+ {TSI_DICTIONARY, "tsi.table", "tsi.bin", "tsi.dbin", SYSTEM_FILE},
{USER_DICTIONARY, NULL, NULL, "user.bin", USER_FILE}
};
diff --git a/src/zhuyin.cpp b/src/zhuyin.cpp
index eba3bb1..f006831 100644
--- a/src/zhuyin.cpp
+++ b/src/zhuyin.cpp
@@ -237,8 +237,7 @@ zhuyin_context_t * zhuyin_init(const char * systemdir, const char * userdir){
context->m_phrase_index = new FacadePhraseIndex;
/* hack here: directly call load phrase library. */
- zhuyin_load_phrase_library(context, GB_DICTIONARY);
- zhuyin_load_phrase_library(context, MERGED_DICTIONARY);
+ zhuyin_load_phrase_library(context, TSI_DICTIONARY);
context->m_system_bigram = new Bigram;
filename = g_build_filename(context->m_system_dir, SYSTEM_BIGRAM, NULL);
@@ -334,8 +333,8 @@ bool zhuyin_load_phrase_library(zhuyin_context_t * context,
bool zhuyin_unload_phrase_library(zhuyin_context_t * context,
guint8 index){
- /* gb_char.bin and merged.bin can't be unloaded. */
- if (GB_DICTIONARY == index || MERGED_DICTIONARY == index)
+ /* tsi.bin can't be unloaded. */
+ if (TSI_DICTIONARY == index)
return false;
assert(index < PHRASE_INDEX_LIBRARY_COUNT);
@@ -378,7 +377,7 @@ bool zhuyin_iterator_add_phrase(import_iterator_t * iter,
/* pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE; */
pinyin_option_t options = USE_TONE;
- FullPinyinParser2 parser;
+ ChewingDirectParser2 parser;
ChewingKeyVector keys =
g_array_new(FALSE, FALSE, sizeof(ChewingKey));
ChewingKeyRestVector key_rests =