diff options
author | Peng Wu <alexepico@gmail.com> | 2015-07-09 13:47:23 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-07-09 13:47:23 +0800 |
commit | 3120d04f1aba5c745a9c7da5f8f40cf7851e9037 (patch) | |
tree | 911423b3da7fc966900c7ed56c6f10cfd9f4d064 /src/storage/ngram_kyotodb.cpp | |
parent | 3b7b004ecd617e392102d70c3828536235435a89 (diff) | |
download | libpinyin-3120d04f1aba5c745a9c7da5f8f40cf7851e9037.tar.gz libpinyin-3120d04f1aba5c745a9c7da5f8f40cf7851e9037.tar.xz libpinyin-3120d04f1aba5c745a9c7da5f8f40cf7851e9037.zip |
fixes Kyoto Cabinet bug
Diffstat (limited to 'src/storage/ngram_kyotodb.cpp')
-rw-r--r-- | src/storage/ngram_kyotodb.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/storage/ngram_kyotodb.cpp b/src/storage/ngram_kyotodb.cpp index 98d44dc..0c62357 100644 --- a/src/storage/ngram_kyotodb.cpp +++ b/src/storage/ngram_kyotodb.cpp @@ -76,6 +76,9 @@ bool Bigram::load_db(const char * dbfile){ /* create on-memory db. */ m_db = new ProtoHashDB; + if ( !m_db->open("-", ProtoHashDB::OWRITER|ProtoHashDB::OCREATE) ) + return false; + /* load db into memory. */ BasicDB * tmp_db = new HashDB; tmp_db->open(dbfile, BasicDB::OREADER); |