diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/Makefile.am | 7 | ||||
-rw-r--r-- | src/storage/ngram_kyotodb.cpp | 3 | ||||
-rw-r--r-- | tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/lookup/Makefile.am | 4 | ||||
-rw-r--r-- | tests/storage/Makefile.am | 4 | ||||
-rw-r--r-- | utils/segment/Makefile.am | 4 | ||||
-rw-r--r-- | utils/storage/Makefile.am | 4 | ||||
-rw-r--r-- | utils/training/Makefile.am | 4 |
9 files changed, 11 insertions, 25 deletions
@@ -1,5 +1,5 @@ version 1.1.91 -* support Kyoto Cabinet as alternatvie to Berkeley DB. +* support Kyoto Cabinet as alternative to Berkeley DB. * improve multiple dictionaries support feature. version 1.1.0 diff --git a/src/Makefile.am b/src/Makefile.am index 5600c86..b38a980 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -49,10 +49,17 @@ libpinyin_la_LIBADD = storage/libstorage.la lookup/liblookup.la @GLIB2_LIBS@ libpinyin_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libpinyin.ver \ -version-info @LT_VERSION_INFO@ +if KYOTOCABINET +libpinyin_la_LDFLAGS += @KYOTOCABINET_LIBS@ +endif + libpinyin_internal_la_SOURCES = pinyin_internal.cpp libpinyin_internal_la_LIBADD = storage/libstorage.la lookup/liblookup.la +if KYOTOCABINET +libpinyin_internal_la_LDFLAGS = @KYOTOCABINET_LIBS@ +endif ## Note: ## As libpinyin internal interface will change, only provides static library 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); diff --git a/tests/Makefile.am b/tests/Makefile.am index 7666a6c..93df7d6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -32,10 +32,6 @@ INCLUDES = -I$(top_srcdir)/src \ LDADD = ../src/libpinyin.la @GLIB2_LIBS@ -if KYOTOCABINET -LDADD += @KYOTOCABINET_LIBS@ -endif - noinst_HEADERS = timer.h \ tests_helper.h diff --git a/tests/lookup/Makefile.am b/tests/lookup/Makefile.am index e36f5be..804d037 100644 --- a/tests/lookup/Makefile.am +++ b/tests/lookup/Makefile.am @@ -24,10 +24,6 @@ INCLUDES = -I$(top_srcdir)/src \ LDADD = ../../src/libpinyin_internal.la @GLIB2_LIBS@ -if KYOTOCABINET -LDADD += @KYOTOCABINET_LIBS@ -endif - noinst_PROGRAMS = test_pinyin_lookup \ test_phrase_lookup diff --git a/tests/storage/Makefile.am b/tests/storage/Makefile.am index 8aec6ba..7675d11 100644 --- a/tests/storage/Makefile.am +++ b/tests/storage/Makefile.am @@ -24,10 +24,6 @@ INCLUDES = -I$(top_srcdir)/src \ LDADD = ../../src/libpinyin_internal.la @GLIB2_LIBS@ -if KYOTOCABINET -LDADD += @KYOTOCABINET_LIBS@ -endif - TESTS = test_phrase_index_logger \ test_ngram \ test_flexible_ngram diff --git a/utils/segment/Makefile.am b/utils/segment/Makefile.am index 8a9c286..8c081d1 100644 --- a/utils/segment/Makefile.am +++ b/utils/segment/Makefile.am @@ -26,10 +26,6 @@ INCLUDES = -I$(top_srcdir)/src \ LDADD = ../../src/libpinyin_internal.la @GLIB2_LIBS@ -if KYOTOCABINET -LDADD += @KYOTOCABINET_LIBS@ -endif - noinst_PROGRAMS = spseg ngseg mergeseq spseg_SOURCES = spseg.cpp diff --git a/utils/storage/Makefile.am b/utils/storage/Makefile.am index a90234a..376c0e7 100644 --- a/utils/storage/Makefile.am +++ b/utils/storage/Makefile.am @@ -24,10 +24,6 @@ INCLUDES = -I$(top_srcdir)/src \ LDADD = ../../src/libpinyin_internal.la @GLIB2_LIBS@ -if KYOTOCABINET -LDADD += @KYOTOCABINET_LIBS@ -endif - bin_PROGRAMS = gen_binary_files \ import_interpolation diff --git a/utils/training/Makefile.am b/utils/training/Makefile.am index 23862ca..8ed4806 100644 --- a/utils/training/Makefile.am +++ b/utils/training/Makefile.am @@ -26,10 +26,6 @@ INCLUDES = -I$(top_srcdir)/src \ LDADD = ../../src/libpinyin_internal.la @GLIB2_LIBS@ -if KYOTOCABINET -LDADD += @KYOTOCABINET_LIBS@ -endif - noinst_HEADERS = k_mixture_model.h bin_PROGRAMS = gen_unigram |