projects
/
platform
/
upstream
/
libpinyin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc70339
)
fixes load text in chewing large table
author
Peng Wu
<alexepico@gmail.com>
Wed, 7 Dec 2011 02:51:49 +0000
(10:51 +0800)
committer
Peng Wu
<alexepico@gmail.com>
Wed, 7 Dec 2011 02:51:49 +0000
(10:51 +0800)
src/storage/chewing_large_table.cpp
patch
|
blob
|
history
diff --git
a/src/storage/chewing_large_table.cpp
b/src/storage/chewing_large_table.cpp
index 703cfb5936e7e9a39703ebb53c5490a582abe730..cf527d80353e8fa9823d62345c4e726f76c28415 100644
(file)
--- 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;
}