diff options
author | Peng Wu <alexepico@gmail.com> | 2013-04-10 14:41:15 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2013-04-10 14:41:15 +0800 |
commit | 8f1b6d0c5574f1367fb4e154d7972ef40e05dcdd (patch) | |
tree | 9c66c9df718bc2701b6239a597a56b7493759aa4 /utils/training/gen_deleted_ngram.cpp | |
parent | 8045de6d4af0594344f8e9116368b02048a06eb5 (diff) | |
download | libpinyin-8f1b6d0c5574f1367fb4e154d7972ef40e05dcdd.tar.gz libpinyin-8f1b6d0c5574f1367fb4e154d7972ef40e05dcdd.tar.xz libpinyin-8f1b6d0c5574f1367fb4e154d7972ef40e05dcdd.zip |
update utils/training
Diffstat (limited to 'utils/training/gen_deleted_ngram.cpp')
-rw-r--r-- | utils/training/gen_deleted_ngram.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/utils/training/gen_deleted_ngram.cpp b/utils/training/gen_deleted_ngram.cpp index 0437a68..5044d92 100644 --- a/utils/training/gen_deleted_ngram.cpp +++ b/utils/training/gen_deleted_ngram.cpp @@ -51,6 +51,14 @@ int main(int argc, char * argv[]){ exit(EINVAL); } + SystemTableInfo system_table_info; + + bool retval = system_table_info.load("table.conf"); + if (!retval) { + fprintf(stderr, "load table.conf failed.\n"); + exit(ENOENT); + } + /* load phrase table. */ PhraseLargeTable2 phrase_table; MemoryChunk * new_chunk = new MemoryChunk; @@ -58,7 +66,11 @@ int main(int argc, char * argv[]){ phrase_table.load(new_chunk); FacadePhraseIndex phrase_index; - if (!load_phrase_index(&phrase_index)) + + const pinyin_table_info_t * phrase_files = + system_table_info.get_table_info(); + + if (!load_phrase_index(phrase_files, &phrase_index)) exit(ENODATA); Bigram bigram; |