diff options
author | Peng Wu <alexepico@gmail.com> | 2012-06-25 11:21:44 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-06-25 11:21:44 +0800 |
commit | b87f5ca4424584cca2623021174f6f5fcdca7c6a (patch) | |
tree | 1f66fa84e17757d332a5d8e1e7dc83119fea398d /utils/training/gen_unigram.cpp | |
parent | e9e00915580f2b9acc31e57e0bf950474d4fc062 (diff) | |
download | libpinyin-b87f5ca4424584cca2623021174f6f5fcdca7c6a.tar.gz libpinyin-b87f5ca4424584cca2623021174f6f5fcdca7c6a.tar.xz libpinyin-b87f5ca4424584cca2623021174f6f5fcdca7c6a.zip |
update utils
Diffstat (limited to 'utils/training/gen_unigram.cpp')
-rw-r--r-- | utils/training/gen_unigram.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/training/gen_unigram.cpp b/utils/training/gen_unigram.cpp index 72bb2a8..52295a7 100644 --- a/utils/training/gen_unigram.cpp +++ b/utils/training/gen_unigram.cpp @@ -36,10 +36,13 @@ int main(int argc, char * argv[]){ * To avoid zero value when computing unigram frequency in float format. */ 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; + guint32 freq = 1; PhraseIndexRange range; int result = phrase_index.get_range(i, range); if ( result == ERROR_OK ) { |