From 1bb50d2455d69047cccc53f0daf0debac73ec403 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 24 May 2011 11:20:51 +0800 Subject: fixes m_N in magic header of gen k mixture model --- utils/training/gen_k_mixture_model.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'utils') 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)) { -- cgit