From: Peng Wu Date: Tue, 19 Feb 2013 05:49:08 +0000 (+0800) Subject: add assert X-Git-Tag: 0.8.91~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=239835a2b3a08fa0c1d8d78981e2eb188909648b;p=platform%2Fupstream%2Flibpinyin.git add assert --- diff --git a/utils/storage/gen_binary_files.cpp b/utils/storage/gen_binary_files.cpp index fcd9cb1..606ea69 100644 --- a/utils/storage/gen_binary_files.cpp +++ b/utils/storage/gen_binary_files.cpp @@ -56,6 +56,7 @@ int main(int argc, char * argv[]){ FacadePhraseIndex phrase_index; for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { const pinyin_table_info_t * table_info = pinyin_phrase_files + i; + assert(table_info->m_dict_index == i); if (SYSTEM_FILE != table_info->m_file_type && DICTIONARY != table_info->m_file_type) diff --git a/utils/training/gen_unigram.cpp b/utils/training/gen_unigram.cpp index 743e12a..d5f40cc 100644 --- a/utils/training/gen_unigram.cpp +++ b/utils/training/gen_unigram.cpp @@ -36,6 +36,7 @@ int main(int argc, char * argv[]){ */ for (size_t i = 0; i < PHRASE_INDEX_LIBRARY_COUNT; ++i) { const pinyin_table_info_t * table_info = pinyin_phrase_files + i; + assert(table_info->m_dict_index == i); if (SYSTEM_FILE != table_info->m_file_type && DICTIONARY != table_info->m_file_type)