summaryrefslogtreecommitdiffstats
path: root/src/pinyin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pinyin.cpp')
-rw-r--r--src/pinyin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 1415876..70a5385 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -1089,9 +1089,11 @@ 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_PARAMETER * bigram_poss +
- (1 - LAMBDA_PARAMETER) *
+ guint32 freq = (lambda * bigram_poss +
+ (1 - lambda) *
cached_item.get_unigram_frequency() /
(gfloat) total_freq) * 256 * 256 * 256;
item->m_freq = freq;