summaryrefslogtreecommitdiffstats
path: root/utils/training
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-04-27 17:01:08 +0800
committerPeng Wu <alexepico@gmail.com>2011-04-27 17:01:08 +0800
commit0b173665c29bd5a2d3b81625e7112cb503d357a9 (patch)
tree31e0aa7940f2ef17820ac63680af46cd8d44a955 /utils/training
parent844ff3da1745e9433f893390e85eb64c5c3fd5aa (diff)
downloadlibpinyin-0b173665c29bd5a2d3b81625e7112cb503d357a9.tar.gz
libpinyin-0b173665c29bd5a2d3b81625e7112cb503d357a9.tar.xz
libpinyin-0b173665c29bd5a2d3b81625e7112cb503d357a9.zip
add remove method to flexible n-gram
Diffstat (limited to 'utils/training')
-rw-r--r--utils/training/estimate_k_mixture_model.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/training/estimate_k_mixture_model.cpp b/utils/training/estimate_k_mixture_model.cpp
index 6399281..88452d1 100644
--- a/utils/training/estimate_k_mixture_model.cpp
+++ b/utils/training/estimate_k_mixture_model.cpp
@@ -8,7 +8,7 @@ parameter_t compute_interpolation(KMixtureModelSingleGram * deleted_bigram,
parameter_t lambda = 0, next_lambda = 0.6;
parameter_t epsilon = 0.001;
- while ( fabs(lambda - next_lambda) > epsilon){
+ while (fabs(lambda - next_lambda) > epsilon){
lambda = next_lambda;
next_lambda = 0;
parameter_t numerator = 0;
@@ -54,6 +54,7 @@ parameter_t compute_interpolation(KMixtureModelSingleGram * deleted_bigram,
}
KMixtureModelArrayHeader header;
assert(deleted_bigram->get_array_header(header));
+ assert(0 != header.m_WC);
next_lambda /= header.m_WC;
g_array_free(array, TRUE);