diff options
Diffstat (limited to 'tests/lookup')
-rw-r--r-- | tests/lookup/test_simple_lookup.cpp | 9 |
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; |