summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-04-11 11:21:17 +0800
committerPeng Wu <alexepico@gmail.com>2013-04-11 11:21:17 +0800
commitd4a39f57c7d2dc715340e0c6cfd73f577ce5a7fa (patch)
tree8a644dadcd5048962c178deb2875d344c66f7dad
parent9ca38247ddc9dfaa5f5d193a3727c4edbd18a799 (diff)
downloadlibpinyin-d4a39f57c7d2dc715340e0c6cfd73f577ce5a7fa.tar.gz
libpinyin-d4a39f57c7d2dc715340e0c6cfd73f577ce5a7fa.tar.xz
libpinyin-d4a39f57c7d2dc715340e0c6cfd73f577ce5a7fa.zip
add lambda parameter
-rw-r--r--tests/lookup/test_phrase_lookup.cpp5
-rw-r--r--tests/lookup/test_pinyin_lookup.cpp7
-rw-r--r--utils/segment/ngseg.cpp5
-rw-r--r--utils/training/eval_correction_rate.cpp7
4 files changed, 18 insertions, 6 deletions
diff --git a/tests/lookup/test_phrase_lookup.cpp b/tests/lookup/test_phrase_lookup.cpp
index 36a070d..c7bfd19 100644
--- a/tests/lookup/test_phrase_lookup.cpp
+++ b/tests/lookup/test_phrase_lookup.cpp
@@ -80,8 +80,11 @@ int main(int argc, char * argv[]){
system_bigram.attach("../../data/bigram.db", ATTACH_READONLY);
Bigram user_bigram;
+ gfloat lambda = system_table_info.get_lambda();
+
/* init phrase lookup */
- PhraseLookup phrase_lookup(&phrase_table, &phrase_index,
+ PhraseLookup phrase_lookup(lambda,
+ &phrase_table, &phrase_index,
&system_bigram, &user_bigram);
/* try one sentence */
diff --git a/tests/lookup/test_pinyin_lookup.cpp b/tests/lookup/test_pinyin_lookup.cpp
index 446d8fd..3175db0 100644
--- a/tests/lookup/test_pinyin_lookup.cpp
+++ b/tests/lookup/test_pinyin_lookup.cpp
@@ -55,9 +55,12 @@ int main( int argc, char * argv[]){
system_bigram.attach("../../data/bigram.db", ATTACH_READONLY);
Bigram user_bigram;
user_bigram.attach(NULL, ATTACH_CREATE|ATTACH_READWRITE);
+
+ gfloat lambda = system_table_info.get_lambda();
- PinyinLookup2 pinyin_lookup(options, &largetable, &phrase_index,
- &system_bigram, &user_bigram);
+ PinyinLookup2 pinyin_lookup(lambda, options,
+ &largetable, &phrase_index,
+ &system_bigram, &user_bigram);
/* prepare the prefixes for get_best_match. */
TokenVector prefixes = g_array_new
diff --git a/utils/segment/ngseg.cpp b/utils/segment/ngseg.cpp
index 57cc164..5fb2a42 100644
--- a/utils/segment/ngseg.cpp
+++ b/utils/segment/ngseg.cpp
@@ -162,8 +162,11 @@ int main(int argc, char * argv[]){
system_bigram.attach("bigram.db", ATTACH_READONLY);
Bigram user_bigram;
+ gfloat lambda = system_table_info.get_lambda();
+
/* init phrase lookup */
- PhraseLookup phrase_lookup(&phrase_table, &phrase_index,
+ PhraseLookup phrase_lookup(lambda,
+ &phrase_table, &phrase_index,
&system_bigram, &user_bigram);
diff --git a/utils/training/eval_correction_rate.cpp b/utils/training/eval_correction_rate.cpp
index a4d8f63..c4883b0 100644
--- a/utils/training/eval_correction_rate.cpp
+++ b/utils/training/eval_correction_rate.cpp
@@ -149,8 +149,11 @@ int main(int argc, char * argv[]){
Bigram user_bigram;
user_bigram.attach(NULL, ATTACH_CREATE|ATTACH_READWRITE);
- PinyinLookup2 pinyin_lookup(options, &largetable, &phrase_index,
- &system_bigram, &user_bigram);
+ gfloat lambda = system_table_info.get_lambda();
+
+ PinyinLookup2 pinyin_lookup(lambda, options,
+ &largetable, &phrase_index,
+ &system_bigram, &user_bigram);
/* open evals text. */
FILE * evals_file = fopen(evals_text, "r");