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:
20fde3f
)
a safe guard for chewing
author
Peng Wu
<alexepico@gmail.com>
Tue, 11 Dec 2012 06:15:49 +0000
(14:15 +0800)
committer
Peng Wu
<alexepico@gmail.com>
Tue, 11 Dec 2012 06:15:49 +0000
(14:15 +0800)
src/storage/phrase_index.h
patch
|
blob
|
history
diff --git
a/src/storage/phrase_index.h
b/src/storage/phrase_index.h
index
aca74f6
..
7b3443c
100644
(file)
--- a/
src/storage/phrase_index.h
+++ b/
src/storage/phrase_index.h
@@
-152,16
+152,15
@@
public:
matched += *freq;
}
}
- // use preprocessor to avoid zero freq, in gen_pinyin_table.
- /*
+
+#if 1
+ /* an additional safe guard for chewing. */
if ( 0 == total_freq )
- return 0.1;
- */
+ return 0;
+#endif
+
+ /* used preprocessor to avoid zero freq, in gen_chewing_table. */
gfloat retval = matched / (gfloat) total_freq;
- /*
- if ( 0 == retval )
- return 0.03;
- */
return retval;
}