summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-05-25 12:59:18 +0800
committerPeng Wu <alexepico@gmail.com>2011-05-25 14:15:27 +0800
commit49cbd833fe1f5c0a65b5c4f58bf465b69896856c (patch)
tree7344bed6d1e394fb68f89c9eeb06ba3d7ec50472 /utils
parent4bb7f472a4fba814d02bdca5b011b5a6f68d4949 (diff)
downloadlibpinyin-49cbd833fe1f5c0a65b5c4f58bf465b69896856c.tar.gz
libpinyin-49cbd833fe1f5c0a65b5c4f58bf465b69896856c.tar.xz
libpinyin-49cbd833fe1f5c0a65b5c4f58bf465b69896856c.zip
fixes a typo
Diffstat (limited to 'utils')
-rw-r--r--utils/training/gen_k_mixture_model.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/utils/training/gen_k_mixture_model.cpp b/utils/training/gen_k_mixture_model.cpp
index 9768fef..ac433d9 100644
--- a/utils/training/gen_k_mixture_model.cpp
+++ b/utils/training/gen_k_mixture_model.cpp
@@ -121,7 +121,6 @@ bool read_document(PhraseLargeTable * phrases, FILE * document,
static void train_word_pair(KMixtureModelSingleGram * single_gram,
phrase_token_t token, guint32 count){
KMixtureModelArrayItem array_item;
- guint32 delta = 0;
bool exists = single_gram->get_array_item(token, array_item);
if ( exists ) {
@@ -139,7 +138,6 @@ static void train_word_pair(KMixtureModelSingleGram * single_gram,
if ( 1 == count )
array_item.m_n_1 ++;
array_item.m_Mr = std_lite::max(array_item.m_Mr, count);
- delta = count;
assert(single_gram->set_array_item(token, array_item));
} else { /* item doesn't exist. */
/* the same as above. */
@@ -152,13 +150,13 @@ static void train_word_pair(KMixtureModelSingleGram * single_gram,
if ( 1 == count )
array_item.m_n_1 = 1;
array_item.m_Mr = count;
- delta = count;
assert(single_gram->insert_array_item(token, array_item));
}
+
/* save delta in the array header. */
KMixtureModelArrayHeader array_header;
single_gram->get_array_header(array_header);
- array_header.m_WC += delta;
+ array_header.m_WC += count;
single_gram->set_array_header(array_header);
}