diff options
author | Peng Wu <alexepico@gmail.com> | 2015-04-21 11:19:00 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-04-21 11:19:00 +0800 |
commit | 107f642630eed151e859583d493ee677b5b063b9 (patch) | |
tree | 872ace6691a67facb5e326eeb118878b5f4d7dac /src/storage/flexible_ngram_kyotodb.h | |
parent | fb3a0fa827098b9c2f8885e1e55e761deccdac1d (diff) | |
download | libpinyin-107f642630eed151e859583d493ee677b5b063b9.tar.gz libpinyin-107f642630eed151e859583d493ee677b5b063b9.tar.xz libpinyin-107f642630eed151e859583d493ee677b5b063b9.zip |
add copy parameter to Bigram::load
Diffstat (limited to 'src/storage/flexible_ngram_kyotodb.h')
-rw-r--r-- | src/storage/flexible_ngram_kyotodb.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/storage/flexible_ngram_kyotodb.h b/src/storage/flexible_ngram_kyotodb.h index a1396d2..660681e 100644 --- a/src/storage/flexible_ngram_kyotodb.h +++ b/src/storage/flexible_ngram_kyotodb.h @@ -184,13 +184,15 @@ public: * FlexibleBigram::load: * @index: the previous token in the flexible bi-gram. * @single_gram: the single gram of the previous token. + * @copy: whether copy content to the single gram. * @returns: whether the load operation is successful. * * Load the single gram of the previous token. * */ bool load(phrase_token_t index, - FlexibleSingleGram<ArrayHeader, ArrayItem> * & single_gram){ + FlexibleSingleGram<ArrayHeader, ArrayItem> * & single_gram, + bool copy=false){ single_gram = NULL; if ( !m_db ) return false; @@ -209,7 +211,7 @@ public: vbuf, vsiz)); single_gram = new FlexibleSingleGram<ArrayHeader, ArrayItem> - (m_chunk.begin(), vsiz); + (m_chunk.begin(), vsiz, copy); return true; } |