summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-09-06 13:57:14 +0800
committerPeng Wu <alexepico@gmail.com>2012-09-06 13:57:14 +0800
commit3ed43e3b45da85037b1d70fd5129b8cba5c5e184 (patch)
treead529538d55972212e6314242e5496d744791723
parent732e8b4010613953e5af74ea6062af24b770f572 (diff)
downloadlibpinyin-3ed43e3b45da85037b1d70fd5129b8cba5c5e184.zip
libpinyin-3ed43e3b45da85037b1d70fd5129b8cba5c5e184.tar.gz
libpinyin-3ed43e3b45da85037b1d70fd5129b8cba5c5e184.tar.xz
fixes export_k_mixture_model.cpp
-rw-r--r--utils/training/export_k_mixture_model.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/training/export_k_mixture_model.cpp b/utils/training/export_k_mixture_model.cpp
index 95ea1ef..4b3d993 100644
--- a/utils/training/export_k_mixture_model.cpp
+++ b/utils/training/export_k_mixture_model.cpp
@@ -130,7 +130,10 @@ int main(int argc, char * argv[]){
exit(ENOENT);
KMixtureModelBigram bigram(K_MIXTURE_MODEL_MAGIC_NUMBER);
- bigram.attach(k_mixture_model_filename, ATTACH_READONLY);
+ if (!bigram.attach(k_mixture_model_filename, ATTACH_READONLY)) {
+ fprintf(stderr, "open %s failed.\n", k_mixture_model_filename);
+ exit(ENOENT);
+ }
print_k_mixture_model_magic_header(output, &bigram);
print_k_mixture_model_array_headers(output, &bigram, &phrase_index);