summaryrefslogtreecommitdiffstats
path: root/utils/training/prune_k_mixture_model.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-07-29 11:47:56 +0800
committerPeng Wu <alexepico@gmail.com>2011-07-29 11:47:56 +0800
commit2f1e4e17542d7e91261e8d05321b2886fbe38298 (patch)
treee4cebe37b250b7a002b6c1b4b28394dca2ff9df3 /utils/training/prune_k_mixture_model.cpp
parent1eb686be6f2ff7692fd4ba4fee58c19436710340 (diff)
downloadlibpinyin-2f1e4e17542d7e91261e8d05321b2886fbe38298.tar.gz
libpinyin-2f1e4e17542d7e91261e8d05321b2886fbe38298.tar.xz
libpinyin-2f1e4e17542d7e91261e8d05321b2886fbe38298.zip
fixes prune tool
Diffstat (limited to 'utils/training/prune_k_mixture_model.cpp')
-rw-r--r--utils/training/prune_k_mixture_model.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/training/prune_k_mixture_model.cpp b/utils/training/prune_k_mixture_model.cpp
index a602f14..832bddc 100644
--- a/utils/training/prune_k_mixture_model.cpp
+++ b/utils/training/prune_k_mixture_model.cpp
@@ -52,9 +52,13 @@ bool prune_k_mixture_model(KMixtureModelMagicHeader * magic_header,
item->m_item.m_n_1);
}
+ if ( fabs(remained_poss) < DBL_EPSILON )
+ remained_poss = 0.;
+
/* wrong remained possibility. */
if (remained_poss < 0) {
- fprintf(stderr, "wrong remained possibility is found.\n");
+ fprintf(stderr, "wrong remained possibility is found:%f.\n",
+ remained_poss);
fprintf(stderr, "k:%d N:%d WC:%d n_0:%d n_1:%d\n",
g_prune_k, magic_header->m_N, item->m_item.m_WC,
magic_header->m_N - item->m_item.m_N_n_0,