summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-06-07 14:39:59 +0800
committerPeng Wu <alexepico@gmail.com>2011-06-07 14:39:59 +0800
commitf1b4b7024df6aa8a279e7ac8fbaf9a5701e446c4 (patch)
tree32d2701f273261bc556e20695f82eb3fde4b9add
parentdce4901ac2edd459ea8d53c210f0aa09115b679e (diff)
downloadlibpinyin-f1b4b7024df6aa8a279e7ac8fbaf9a5701e446c4.tar.gz
libpinyin-f1b4b7024df6aa8a279e7ac8fbaf9a5701e446c4.tar.xz
libpinyin-f1b4b7024df6aa8a279e7ac8fbaf9a5701e446c4.zip
add unigram to export k mixture model tool
-rw-r--r--utils/training/export_k_mixture_model.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/utils/training/export_k_mixture_model.cpp b/utils/training/export_k_mixture_model.cpp
index f2716fb..87a4577 100644
--- a/utils/training/export_k_mixture_model.cpp
+++ b/utils/training/export_k_mixture_model.cpp
@@ -33,8 +33,9 @@ bool print_k_mixture_model_magic_header(FILE * output,
fprintf(stderr, "no magic header in k mixture model.\n");
exit(ENODATA);
}
- fprintf(output, "\\data model \"k mixture model\" count %d N %d\n",
- magic_header.m_WC, magic_header.m_N);
+ fprintf(output, "\\data model \"k mixture model\" count %d N %d "
+ "total_freq %d\n", magic_header.m_WC, magic_header.m_N,
+ magic_header.m_total_freq);
return true;
}
@@ -51,7 +52,8 @@ bool print_k_mixture_model_array_headers(FILE * output,
assert(bigram->get_array_header(*token, array_header));
char * phrase = taglib_token_to_string(phrase_index, *token);
if ( phrase )
- fprintf(output, "\\item %s count %d\n", phrase, array_header.m_WC);
+ fprintf(output, "\\item %s count %d freq %d\n",
+ phrase, array_header.m_WC, array_header.m_freq);
g_free(phrase);
}