summaryrefslogtreecommitdiffstats
path: root/tests/lookup
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-04-18 16:59:03 +0800
committerPeng Wu <alexepico@gmail.com>2011-04-18 16:59:03 +0800
commitc418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5 (patch)
tree6833bd52722b0655858f060e8b7fe0df7e0568ce /tests/lookup
parent0b113f330653b82be8a87af8b8b4ac826e72b296 (diff)
downloadlibpinyin-c418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5.tar.gz
libpinyin-c418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5.tar.xz
libpinyin-c418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5.zip
use new bi-gram
Diffstat (limited to 'tests/lookup')
-rw-r--r--tests/lookup/test_simple_lookup.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/lookup/test_simple_lookup.cpp b/tests/lookup/test_simple_lookup.cpp
index 147d8d6..77fa797 100644
--- a/tests/lookup/test_simple_lookup.cpp
+++ b/tests/lookup/test_simple_lookup.cpp
@@ -44,10 +44,13 @@ int main( int argc, char * argv[]){
new_chunk->load("../../data/gbk_char.bin");
phrase_index.load(2, new_chunk);
- Bigram bigram;
- bigram.attach("../../data/bigram.db", "/tmp/bigram.db");
+ Bigram system_bigram;
+ system_bigram.attach("../../data/bigram.db", ATTACH_READONLY);
+ Bigram user_bigram;
+ user_bigram.attach("/tmp/bigram.db", ATTACH_CREATE|ATTACH_READWRITE);
- PinyinLookup pinyin_lookup(&custom, &largetable, &phrase_index, &bigram);
+ PinyinLookup pinyin_lookup(&custom, &largetable, &phrase_index,
+ &system_bigram, &user_bigram);
char* linebuf = (char *)malloc ( 1024 * sizeof (char) );
size_t size = 1024;