summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/training/gen_k_mixture_model.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/utils/training/gen_k_mixture_model.cpp b/utils/training/gen_k_mixture_model.cpp
index d0b327a..8fc6946 100644
--- a/utils/training/gen_k_mixture_model.cpp
+++ b/utils/training/gen_k_mixture_model.cpp
@@ -185,12 +185,9 @@ static void train_single_gram_wrapper(gpointer key, gpointer value,
KMixtureModelSingleGram * single_gram = NULL;
bool exists = g_k_mixture_model->load(token, single_gram);
- if ( exists ){
- train_single_gram(token, single_gram, delta);
- } else { /* item doesn't exist. */
+ if ( !exists )
single_gram = new KMixtureModelSingleGram;
- train_single_gram(token, single_gram, delta);
- }
+ train_single_gram(token, single_gram, delta);
KMixtureModelMagicHeader magic_header;
assert(g_k_mixture_model->get_magic_header(magic_header));
@@ -275,7 +272,7 @@ int main(int argc, char * argv[]){
g_hash_of_document = NULL;
++i;
- }
+ }
delete g_phrases;
delete g_k_mixture_model;