summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-06-08 13:19:28 +0800
committerPeng Wu <alexepico@gmail.com>2011-06-08 13:19:28 +0800
commite14ce09105fb44019b3a60dfd70a5b63d05b9fff (patch)
tree2c271c254d272b23423f6f4faee2a9d836451754 /utils
parenta6604222afc1d3c6b5612752ef30377307bc09a7 (diff)
downloadlibpinyin-e14ce09105fb44019b3a60dfd70a5b63d05b9fff.tar.gz
libpinyin-e14ce09105fb44019b3a60dfd70a5b63d05b9fff.tar.xz
libpinyin-e14ce09105fb44019b3a60dfd70a5b63d05b9fff.zip
ignore zero items in conversion tool
Diffstat (limited to 'utils')
-rw-r--r--utils/training/k_mixture_model_to_interpolation.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/training/k_mixture_model_to_interpolation.cpp b/utils/training/k_mixture_model_to_interpolation.cpp
index dcae87e..870b6af 100644
--- a/utils/training/k_mixture_model_to_interpolation.cpp
+++ b/utils/training/k_mixture_model_to_interpolation.cpp
@@ -101,8 +101,9 @@ bool parse_unigram(FILE * input, FILE * output){
gpointer value = NULL;
assert(g_hash_table_lookup_extended(required, "freq",
NULL, &value));
- const char * freq = (const char *) value;
- fprintf(output, "\\item %s count %s\n", string, freq);
+ glong freq = atol ((const char *) value);
+ if ( 0 != freq )
+ fprintf(output, "\\item %s count %d\n", string, freq);
break;
}
case END_LINE: