diff options
author | Peng Wu <alexepico@gmail.com> | 2015-04-14 16:45:14 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-04-14 16:45:14 +0800 |
commit | f18291a36a316496e63142cc34b01377c6b5a58e (patch) | |
tree | 7de7e101c7859dfb72bef5e3b10ab51d0ac80596 /src/storage/ngram_bdb.cpp | |
parent | e8d9463f45a7214e0eb36cfe09f45cce3b7baeb9 (diff) | |
download | libpinyin-f18291a36a316496e63142cc34b01377c6b5a58e.tar.gz libpinyin-f18291a36a316496e63142cc34b01377c6b5a58e.tar.xz libpinyin-f18291a36a316496e63142cc34b01377c6b5a58e.zip |
write ngram_kyotodb.cpp in progress
Diffstat (limited to 'src/storage/ngram_bdb.cpp')
-rw-r--r-- | src/storage/ngram_bdb.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/storage/ngram_bdb.cpp b/src/storage/ngram_bdb.cpp index e07127b..9d696ff 100644 --- a/src/storage/ngram_bdb.cpp +++ b/src/storage/ngram_bdb.cpp @@ -140,8 +140,10 @@ bool Bigram::save_db(const char * dbfile){ if ( cursorp != NULL ) cursorp->c_close(cursorp); - if ( tmp_db != NULL ) + if ( tmp_db != NULL ) { + tmp_db->sync(m_db, 0); tmp_db->close(tmp_db, 0); + } return true; } @@ -256,6 +258,7 @@ bool Bigram::get_all_items(GArray * items){ return true; } +/* Note: sync mask_out code with ngram_kyotodb.cpp. */ bool Bigram::mask_out(phrase_token_t mask, phrase_token_t value){ GArray * items = g_array_new(FALSE, FALSE, sizeof(phrase_token_t)); |