summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/training/gen_k_mixture_model.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/training/gen_k_mixture_model.cpp b/utils/training/gen_k_mixture_model.cpp
index 0d7204f..fd48f51 100644
--- a/utils/training/gen_k_mixture_model.cpp
+++ b/utils/training/gen_k_mixture_model.cpp
@@ -216,7 +216,6 @@ static bool train_second_word(HashofDocument hash_of_document,
return false;
}
magic_header.m_WC += delta;
- magic_header.m_N ++;
assert(bigram->set_magic_header(magic_header));
/* save the single gram. */
@@ -294,6 +293,11 @@ int main(int argc, char * argv[]){
train_second_word(hash_of_document, &bigram, token);
}
+ KMixtureModelMagicHeader magic_header;
+ assert(bigram.get_magic_header(magic_header));
+ magic_header.m_N ++;
+ assert(bigram.set_magic_header(magic_header));
+
/* free resources of g_hash_of_document */
g_hash_table_iter_init(&iter, hash_of_document);
while (g_hash_table_iter_next(&iter, &key, &value)) {