summaryrefslogtreecommitdiffstats
path: root/utils/storage/import_interpolation.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-04-18 16:59:03 +0800
committerPeng Wu <alexepico@gmail.com>2011-04-18 16:59:03 +0800
commitc418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5 (patch)
tree6833bd52722b0655858f060e8b7fe0df7e0568ce /utils/storage/import_interpolation.cpp
parent0b113f330653b82be8a87af8b8b4ac826e72b296 (diff)
downloadlibpinyin-c418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5.tar.gz
libpinyin-c418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5.tar.xz
libpinyin-c418ddb0e8ec1eb8e79cb03e83ed3ebc202d02e5.zip
use new bi-gram
Diffstat (limited to 'utils/storage/import_interpolation.cpp')
-rw-r--r--utils/storage/import_interpolation.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/utils/storage/import_interpolation.cpp b/utils/storage/import_interpolation.cpp
index d53c3e8..d8d32e4 100644
--- a/utils/storage/import_interpolation.cpp
+++ b/utils/storage/import_interpolation.cpp
@@ -157,15 +157,14 @@ bool parse_bigram(FILE * input, PhraseLargeTable * phrases,
last_token = 0;
last_single_gram = NULL;
}
- SingleGram * system_gram = NULL, * user_gram = NULL;
- bigram->load(token1, system_gram, user_gram);
- assert(system_gram == NULL);
+ SingleGram * single_gram = NULL;
+ bigram->load(token1, single_gram);
//create the new single gram
- if ( user_gram == NULL )
- user_gram = new SingleGram;
+ if ( single_gram == NULL )
+ single_gram = new SingleGram;
last_token = token1;
- last_single_gram = user_gram;
+ last_single_gram = single_gram;
}
//save the freq
guint32 total_freq = 0;
@@ -220,7 +219,7 @@ int main(int argc, char * argv[]){
phrase_index.load(2, chunk);
Bigram bigram;
- bigram.attach(NULL, bigram_filename);
+ bigram.attach(bigram_filename, ATTACH_CREATE|ATTACH_READWRITE);
taglib_init();