summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-01-10 12:55:25 +0800
committerPeng Wu <alexepico@gmail.com>2012-01-10 12:55:31 +0800
commitfabe3b1fd6b6ccab4f9f8b606a8503aee08c738d (patch)
treec9de43cc1ee49d1f4c91a5290e2f40783adb3266
parent742de0a367e511388ff197f6c21d586877698dda (diff)
downloadlibpinyin-fabe3b1fd6b6ccab4f9f8b606a8503aee08c738d.zip
libpinyin-fabe3b1fd6b6ccab4f9f8b606a8503aee08c738d.tar.gz
libpinyin-fabe3b1fd6b6ccab4f9f8b606a8503aee08c738d.tar.xz
use facade * table
-rw-r--r--tests/lookup/test_phrase_lookup.cpp4
-rw-r--r--tests/lookup/test_pinyin_lookup.cpp4
-rw-r--r--utils/segment/ngseg.cpp4
-rw-r--r--utils/training/eval_correction_rate.cpp8
4 files changed, 10 insertions, 10 deletions
diff --git a/tests/lookup/test_phrase_lookup.cpp b/tests/lookup/test_phrase_lookup.cpp
index 63ebf8f..cf08dff 100644
--- a/tests/lookup/test_phrase_lookup.cpp
+++ b/tests/lookup/test_phrase_lookup.cpp
@@ -70,10 +70,10 @@ int main(int argc, char * argv[]){
//init phrase table
- PhraseLargeTable phrase_table;
+ FacadePhraseTable phrase_table;
MemoryChunk * chunk = new MemoryChunk;
chunk->load("../../data/phrase_index.bin");
- phrase_table.load(chunk);
+ phrase_table.load(chunk, NULL);
//init phrase index
FacadePhraseIndex phrase_index;
diff --git a/tests/lookup/test_pinyin_lookup.cpp b/tests/lookup/test_pinyin_lookup.cpp
index e8722af..4607b5b 100644
--- a/tests/lookup/test_pinyin_lookup.cpp
+++ b/tests/lookup/test_pinyin_lookup.cpp
@@ -7,11 +7,11 @@ size_t bench_times = 100;
int main( int argc, char * argv[]){
pinyin_option_t options = USE_TONE | PINYIN_CORRECT_ALL | PINYIN_AMB_ALL;
- ChewingLargeTable largetable(options);
+ FacadeChewingTable largetable;
MemoryChunk * new_chunk = new MemoryChunk;
new_chunk->load("../../data/pinyin_index.bin");
- largetable.load(new_chunk);
+ largetable.load(options, new_chunk, NULL);
FacadePhraseIndex phrase_index;
new_chunk = new MemoryChunk;
diff --git a/utils/segment/ngseg.cpp b/utils/segment/ngseg.cpp
index 8e56414..56afd30 100644
--- a/utils/segment/ngseg.cpp
+++ b/utils/segment/ngseg.cpp
@@ -109,10 +109,10 @@ int main(int argc, char * argv[]){
}
//init phrase table
- PhraseLargeTable phrase_table;
+ FacadePhraseTable phrase_table;
MemoryChunk * chunk = new MemoryChunk;
chunk->load("phrase_index.bin");
- phrase_table.load(chunk);
+ phrase_table.load(chunk, NULL);
//init phrase index
FacadePhraseIndex phrase_index;
diff --git a/utils/training/eval_correction_rate.cpp b/utils/training/eval_correction_rate.cpp
index 34fa019..b174332 100644
--- a/utils/training/eval_correction_rate.cpp
+++ b/utils/training/eval_correction_rate.cpp
@@ -107,11 +107,11 @@ int main(int argc, char * argv[]){
const char * evals_text = "evals.text";
pinyin_option_t options = USE_TONE;
- ChewingLargeTable largetable(options);
+ FacadeChewingTable largetable;
MemoryChunk * new_chunk = new MemoryChunk;
new_chunk->load("pinyin_index.bin");
- largetable.load(new_chunk);
+ largetable.load(options, new_chunk, NULL);
FacadePhraseIndex phrase_index;
new_chunk = new MemoryChunk;
@@ -121,10 +121,10 @@ int main(int argc, char * argv[]){
new_chunk->load("gbk_char.bin");
phrase_index.load(2, new_chunk);
- PhraseLargeTable phrases;
+ FacadePhraseTable phrases;
new_chunk = new MemoryChunk;
new_chunk->load("phrase_index.bin");
- phrases.load(new_chunk);
+ phrases.load(new_chunk, NULL);
Bigram system_bigram;
system_bigram.attach("bigram.db", ATTACH_READONLY);