diff options
author | Peng Wu <alexepico@gmail.com> | 2013-06-17 13:45:56 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2013-06-17 13:51:20 +0800 |
commit | fff35792df8d7ae0e65a20b2e507f7fabbd8becb (patch) | |
tree | f539e57fb0bc4288bf43f38dff8fb341a68da271 /src/storage/chewing_large_table.cpp | |
parent | 959bfefcb2a7829231b207c34ab76353f4ad41e5 (diff) | |
download | libpinyin-fff35792df8d7ae0e65a20b2e507f7fabbd8becb.tar.gz libpinyin-fff35792df8d7ae0e65a20b2e507f7fabbd8becb.tar.xz libpinyin-fff35792df8d7ae0e65a20b2e507f7fabbd8becb.zip |
fixes load_text
Diffstat (limited to 'src/storage/chewing_large_table.cpp')
-rw-r--r-- | src/storage/chewing_large_table.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/storage/chewing_large_table.cpp b/src/storage/chewing_large_table.cpp index 85246c3..2eb8658 100644 --- a/src/storage/chewing_large_table.cpp +++ b/src/storage/chewing_large_table.cpp @@ -668,10 +668,11 @@ bool ChewingLargeTable::load_text(FILE * infile) { size_t freq; while (!feof(infile)) { - fscanf(infile, "%s", pinyin); - fscanf(infile, "%s", phrase); - fscanf(infile, "%u", &token); - fscanf(infile, "%ld", &freq); + int num = fscanf(infile, "%s %s %u %ld", + pinyin, phrase, &token, &freq); + + if (4 != num) + continue; if(feof(infile)) break; |