diff options
author | Peng Wu <alexepico@gmail.com> | 2011-05-05 11:13:34 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-05-05 11:13:34 +0800 |
commit | 5f987095add7f63c7389fc5255c74fc408351c71 (patch) | |
tree | d9ceaf3db292e659756422883352074dd79af727 /utils | |
parent | d91e11a3e0e3215db7b87eb902dc7e7f9974823f (diff) | |
download | libpinyin-5f987095add7f63c7389fc5255c74fc408351c71.tar.gz libpinyin-5f987095add7f63c7389fc5255c74fc408351c71.tar.xz libpinyin-5f987095add7f63c7389fc5255c74fc408351c71.zip |
refine attach method in flexible n-gram
Diffstat (limited to 'utils')
-rw-r--r-- | utils/training/estimate_k_mixture_model.cpp | 4 | ||||
-rw-r--r-- | utils/training/prune_k_mixture_model.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/utils/training/estimate_k_mixture_model.cpp b/utils/training/estimate_k_mixture_model.cpp index 12c6ac5..58d6b70 100644 --- a/utils/training/estimate_k_mixture_model.cpp +++ b/utils/training/estimate_k_mixture_model.cpp @@ -121,10 +121,10 @@ int main(int argc, char * argv[]){ /* TODO: magic header signature check here. */ KMixtureModelBigram bigram(K_MIXTURE_MODEL_MAGIC_NUMBER); - bigram.attach(bigram_filename); + bigram.attach(bigram_filename, ATTACH_READONLY); KMixtureModelBigram deleted_bigram(K_MIXTURE_MODEL_MAGIC_NUMBER); - deleted_bigram.attach(deleted_bigram_filename); + deleted_bigram.attach(deleted_bigram_filename, ATTACH_READONLY); GArray * deleted_items = g_array_new(FALSE, FALSE, sizeof(phrase_token_t)); deleted_bigram.get_all_items(deleted_items); diff --git a/utils/training/prune_k_mixture_model.cpp b/utils/training/prune_k_mixture_model.cpp index 7a724a9..09243f3 100644 --- a/utils/training/prune_k_mixture_model.cpp +++ b/utils/training/prune_k_mixture_model.cpp @@ -90,7 +90,7 @@ int main(int argc, char * argv[]){ /* TODO: magic header signature check here. */ KMixtureModelBigram bigram(K_MIXTURE_MODEL_MAGIC_NUMBER); - bigram.attach(bigram_filename); + bigram.attach(bigram_filename, ATTACH_READWRITE); KMixtureModelMagicHeader magic_header; bigram.get_magic_header(magic_header); |