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:
d835872
)
fixes feed_file
author
Peng Wu
<alexepico@gmail.com>
Mon, 17 Jun 2013 06:29:29 +0000
(14:29 +0800)
committer
Peng Wu
<alexepico@gmail.com>
Mon, 17 Jun 2013 06:29:29 +0000
(14:29 +0800)
utils/storage/gen_pinyin_table.cpp
patch
|
blob
|
history
diff --git
a/utils/storage/gen_pinyin_table.cpp
b/utils/storage/gen_pinyin_table.cpp
index
853e8c8
..
3b541d1
100644
(file)
--- a/
utils/storage/gen_pinyin_table.cpp
+++ b/
utils/storage/gen_pinyin_table.cpp
@@
-143,11
+143,15
@@
void feed_file ( const char * filename){
}
while ( !feof(infile)){
- fscanf(infile, "%s", phrase);
- fscanf(infile, "%s", pinyin);
- fscanf(infile, "%u", &freq);
+ int num = fscanf(infile, "%s %s %u",
+ phrase, pinyin, &freq);
+
+ if (3 != num)
+ continue;
+
if (feof(infile))
break;
+
feed_line(phrase, pinyin, freq);
}