From 417081e2ebe587bdb207241eb1e365c0d72d772f Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 7 Dec 2011 10:51:49 +0800 Subject: fixes load text in chewing large table --- src/storage/chewing_large_table.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit