summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-02-19 13:49:08 +0800
committerPeng Wu <alexepico@gmail.com>2013-02-19 13:49:08 +0800
commit239835a2b3a08fa0c1d8d78981e2eb188909648b (patch)
tree678a013d0ac1e1648f2c978144cacfce92310671
parentbbc4626d79a44be615665b1aabf274579a48b281 (diff)
downloadlibpinyin-239835a2b3a08fa0c1d8d78981e2eb188909648b.zip
libpinyin-239835a2b3a08fa0c1d8d78981e2eb188909648b.tar.gz
libpinyin-239835a2b3a08fa0c1d8d78981e2eb188909648b.tar.xz
add assert
-rw-r--r--utils/storage/gen_binary_files.cpp1
-rw-r--r--utils/training/gen_unigram.cpp1
2 files changed, 2 insertions, 0 deletions
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)