summaryrefslogtreecommitdiffstats
path: root/src/lookup/pinyin_lookup2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lookup/pinyin_lookup2.cpp')
-rw-r--r--src/lookup/pinyin_lookup2.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lookup/pinyin_lookup2.cpp b/src/lookup/pinyin_lookup2.cpp
index f4ec3ac..8be5c0c 100644
--- a/src/lookup/pinyin_lookup2.cpp
+++ b/src/lookup/pinyin_lookup2.cpp
@@ -26,9 +26,10 @@
using namespace pinyin;
-const gfloat PinyinLookup2::bigram_lambda = LAMBDA_PARAMETER;
-const gfloat PinyinLookup2::unigram_lambda = 1 - LAMBDA_PARAMETER;
-
+/*
+const gfloat PinyinLookup2::bigram_lambda = lambda;
+const gfloat PinyinLookup2::unigram_lambda = 1 - lambda;
+*/
/* internal definition */
static const size_t nbeam = 32;
@@ -184,11 +185,15 @@ static void clear_steps(GPtrArray * steps_index, GPtrArray * steps_content){
}
-PinyinLookup2::PinyinLookup2(pinyin_option_t options,
+PinyinLookup2::PinyinLookup2(const gfloat lambda,
+ pinyin_option_t options,
FacadeChewingTable * pinyin_table,
FacadePhraseIndex * phrase_index,
Bigram * system_bigram,
- Bigram * user_bigram){
+ Bigram * user_bigram)
+ : bigram_lambda(lambda),
+ unigram_lambda(1. - lambda)
+{
m_options = options;
m_pinyin_table = pinyin_table;
m_phrase_index = phrase_index;