summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-07-09 13:47:23 +0800
committerPeng Wu <alexepico@gmail.com>2015-07-09 13:47:23 +0800
commit3120d04f1aba5c745a9c7da5f8f40cf7851e9037 (patch)
tree911423b3da7fc966900c7ed56c6f10cfd9f4d064
parent3b7b004ecd617e392102d70c3828536235435a89 (diff)
downloadlibpinyin-3120d04f1aba5c745a9c7da5f8f40cf7851e9037.tar.gz
libpinyin-3120d04f1aba5c745a9c7da5f8f40cf7851e9037.tar.xz
libpinyin-3120d04f1aba5c745a9c7da5f8f40cf7851e9037.zip
fixes Kyoto Cabinet bug
-rw-r--r--src/storage/ngram_kyotodb.cpp3
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);