summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-05-28 15:26:26 +0800
committerPeng Wu <alexepico@gmail.com>2015-05-28 15:26:26 +0800
commit76db8f184c3ed7e09195e4168bc3453e4d38b148 (patch)
tree0308b94366a2612e7cdb019eb9e1ea0271de25cf
parent98f764e4acba396297a4776bb1d6293c5e3e5e9c (diff)
downloadlibpinyin-76db8f184c3ed7e09195e4168bc3453e4d38b148.tar.gz
libpinyin-76db8f184c3ed7e09195e4168bc3453e4d38b148.tar.xz
libpinyin-76db8f184c3ed7e09195e4168bc3453e4d38b148.zip
fixes compile
-rw-r--r--src/pinyin.cpp6
1 files 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;