diff options
author | Peng Wu <alexepico@gmail.com> | 2011-12-07 10:51:49 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-12-07 10:51:49 +0800 |
commit | 417081e2ebe587bdb207241eb1e365c0d72d772f (patch) | |
tree | 404b2cd7d23f57393dedf130a4b63aca0518818b /src | |
parent | fc70339dea4380ddf3ccc5956346dceb8b0f7916 (diff) | |
download | libpinyin-417081e2ebe587bdb207241eb1e365c0d72d772f.tar.gz libpinyin-417081e2ebe587bdb207241eb1e365c0d72d772f.tar.xz libpinyin-417081e2ebe587bdb207241eb1e365c0d72d772f.zip |
fixes load text in chewing large table
Diffstat (limited to 'src')
-rw-r--r-- | src/storage/chewing_large_table.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/storage/chewing_large_table.cpp b/src/storage/chewing_large_table.cpp index 703cfb5..cf527d8 100644 --- a/src/storage/chewing_large_table.cpp +++ b/src/storage/chewing_large_table.cpp @@ -637,6 +637,8 @@ bool ChewingLargeTable::load_text(FILE * infile) { if(feof(infile)) break; + glong len = g_utf8_strlen(phrase, -1); + FullPinyinParser2 parser; ChewingKeyVector keys; ChewingKeyRestVector key_rests; @@ -647,7 +649,7 @@ bool ChewingLargeTable::load_text(FILE * infile) { pinyin_option_t options = USE_TONE; parser.parse(options, keys, key_rests, pinyin, strlen(pinyin)); - if (0 == keys->len) { + if (len != keys->len) { fprintf(stderr, "%s\t%s\t%u\t%ld\n", pinyin, phrase, token, freq); continue; } |