diff options
Diffstat (limited to 'utils/utils_helper.h')
-rw-r--r-- | utils/utils_helper.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/utils/utils_helper.h b/utils/utils_helper.h index 29e776a..152807b 100644 --- a/utils/utils_helper.h +++ b/utils/utils_helper.h @@ -26,10 +26,13 @@ static bool load_phrase_index(FacadePhraseIndex * phrase_index) { MemoryChunk * chunk = NULL; for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { - const char * binfile = pinyin_phrase_files[i]; - if (NULL == binfile) + const pinyin_table_info_t * table_info = pinyin_phrase_files + i; + + if (SYSTEM_FILE != table_info->m_file_type) continue; + const char * binfile = table_info->m_system_filename; + chunk = new MemoryChunk; bool retval = chunk->load(binfile); if (!retval) { @@ -45,10 +48,13 @@ static bool load_phrase_index(FacadePhraseIndex * phrase_index) { static bool save_phrase_index(FacadePhraseIndex * phrase_index) { MemoryChunk * new_chunk = NULL; for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { - const char * binfile = pinyin_phrase_files[i]; - if (NULL == binfile) + const pinyin_table_info_t * table_info = pinyin_phrase_files + i; + + if (SYSTEM_FILE != table_info->m_file_type) continue; + const char * binfile = table_info->m_system_filename; + new_chunk = new MemoryChunk; phrase_index->store(i, new_chunk); bool retval = new_chunk->save(binfile); |