From 76db8f184c3ed7e09195e4168bc3453e4d38b148 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 28 May 2015 15:26:26 +0800 Subject: fixes compile --- src/pinyin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pinyin.cpp b/src/pinyin.cpp index e7da8db..35ab5ce 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -1456,6 +1456,8 @@ static void _compute_frequency_of_items(pinyin_context_t * context, gfloat bigram_poss = 0; guint32 total_freq = 0; + gfloat lambda = context->m_system_table_info.get_lambda(); + /* handle addon candidates first. */ if (ADDON_CANDIDATE == item->m_candidate_type) { total_freq = context->m_phrase_index-> @@ -1489,8 +1491,6 @@ static void _compute_frequency_of_items(pinyin_context_t * context, total_freq = phrase_index->get_phrase_index_total_freq(); assert (0 < total_freq); - gfloat lambda = context->m_system_table_info.get_lambda(); - /* Note: possibility value <= 1.0. */ guint32 freq = (lambda * bigram_poss + (1 - lambda) * @@ -2272,7 +2272,7 @@ int pinyin_choose_candidate(pinyin_instance_t * instance, ucs4_t phrase[MAX_PHRASE_LENGTH]; item.get_phrase_string(phrase); context->m_phrase_table->add_index(len, phrase, token); - context->m_phrase_index->add_phrase_item(token, item); + context->m_phrase_index->add_phrase_item(token, &item); /* update the candidate. */ candidate->m_candidate_type = NORMAL_CANDIDATE; -- cgit v1.2.1