summaryrefslogtreecommitdiffstats
path: root/src/storage/ngram.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage/ngram.cpp')
-rw-r--r--src/storage/ngram.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/storage/ngram.cpp b/src/storage/ngram.cpp
index 4f4e787..1c99948 100644
--- a/src/storage/ngram.cpp
+++ b/src/storage/ngram.cpp
@@ -39,8 +39,11 @@ SingleGram::SingleGram(){
memset(m_chunk.begin(), 0, sizeof(guint32));
}
-SingleGram::SingleGram(void * buffer, size_t length){
- m_chunk.set_chunk(buffer, length, NULL);
+SingleGram::SingleGram(void * buffer, size_t length, bool copy){
+ if (copy)
+ m_chunk.set_content(0, buffer, length);
+ else
+ m_chunk.set_chunk(buffer, length, NULL);
}
bool SingleGram::get_total_freq(guint32 & total) const{