diff options
author | Peng Wu <alexepico@gmail.com> | 2020-08-21 20:36:43 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2020-08-21 20:36:43 +0800 |
commit | 079cbf27c96d31ca487f7137cd8262f553b095f0 (patch) | |
tree | d595f593fc4af5f1e30bcaba33caedb684c6519d | |
parent | 89972e4d34331fe199633b10408f0656f7361e32 (diff) | |
download | libpinyin-079cbf27c96d31ca487f7137cd8262f553b095f0.tar.gz libpinyin-079cbf27c96d31ca487f7137cd8262f553b095f0.tar.xz libpinyin-079cbf27c96d31ca487f7137cd8262f553b095f0.zip |
improve Kyoto Cabinet usage
-rw-r--r-- | src/storage/chewing_large_table2_kyotodb.cpp | 6 | ||||
-rw-r--r-- | src/storage/ngram_kyotodb.cpp | 6 | ||||
-rw-r--r-- | src/storage/phrase_large_table3_kyotodb.cpp | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/storage/chewing_large_table2_kyotodb.cpp b/src/storage/chewing_large_table2_kyotodb.cpp index b2bc9fc..bfe20cd 100644 --- a/src/storage/chewing_large_table2_kyotodb.cpp +++ b/src/storage/chewing_large_table2_kyotodb.cpp @@ -20,7 +20,7 @@ #include "chewing_large_table2.h" #include <kchashdb.h> -#include <kcprotodb.h> +#include <kccachedb.h> #include "kyotodb_utils.h" using namespace kyotocabinet; @@ -29,7 +29,7 @@ namespace pinyin{ ChewingLargeTable2::ChewingLargeTable2() { /* create in-memory db. */ - m_db = new ProtoTreeDB; + m_db = new GrassDB; assert(m_db->open("-", BasicDB::OREADER|BasicDB::OWRITER|BasicDB::OCREATE)); m_entries = NULL; @@ -71,7 +71,7 @@ bool ChewingLargeTable2::load_db(const char * filename) { init_entries(); /* create in-memory db. */ - m_db = new ProtoTreeDB; + m_db = new GrassDB; if (!m_db->open("-", BasicDB::OREADER|BasicDB::OWRITER|BasicDB::OCREATE)) return false; diff --git a/src/storage/ngram_kyotodb.cpp b/src/storage/ngram_kyotodb.cpp index 98f2f59..1529976 100644 --- a/src/storage/ngram_kyotodb.cpp +++ b/src/storage/ngram_kyotodb.cpp @@ -22,7 +22,7 @@ #include <assert.h> #include <errno.h> #include <kchashdb.h> -#include <kcprotodb.h> +#include <kcstashdb.h> #include "kyotodb_utils.h" @@ -50,12 +50,12 @@ void Bigram::reset(){ } -/* Use ProtoHashDB for load_db/save_db methods. */ +/* Use StashDB for load_db/save_db methods. */ bool Bigram::load_db(const char * dbfile){ reset(); /* create in-memory db. */ - m_db = new ProtoHashDB; + m_db = new StashDB; if ( !m_db->open("-", BasicDB::OREADER|BasicDB::OWRITER|BasicDB::OCREATE) ) return false; diff --git a/src/storage/phrase_large_table3_kyotodb.cpp b/src/storage/phrase_large_table3_kyotodb.cpp index 529aa65..b72c717 100644 --- a/src/storage/phrase_large_table3_kyotodb.cpp +++ b/src/storage/phrase_large_table3_kyotodb.cpp @@ -20,7 +20,7 @@ #include "phrase_large_table3.h" #include <kchashdb.h> -#include <kcprotodb.h> +#include <kccachedb.h> #include "kyotodb_utils.h" @@ -30,7 +30,7 @@ namespace pinyin{ PhraseLargeTable3::PhraseLargeTable3() { /* create in-memory db. */ - m_db = new ProtoTreeDB; + m_db = new GrassDB; assert(m_db->open("-", BasicDB::OREADER|BasicDB::OWRITER|BasicDB::OCREATE)); m_entry = new PhraseTableEntry; @@ -75,7 +75,7 @@ bool PhraseLargeTable3::load_db(const char * filename) { m_entry = new PhraseTableEntry; /* create in-memory db. */ - m_db = new ProtoTreeDB; + m_db = new GrassDB; if (!m_db->open("-", BasicDB::OREADER|BasicDB::OWRITER|BasicDB::OCREATE)) return false; |