summaryrefslogtreecommitdiffstats
path: root/utils/segment/ngseg.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-05-17 14:38:38 +0800
committerPeng Wu <alexepico@gmail.com>2012-05-17 14:38:38 +0800
commit2c7b0915ced93c79938826e05922f4230c94d332 (patch)
treeda6406efa6b61b66c9bd4c4bfe3a1019c041b7d8 /utils/segment/ngseg.cpp
parent347291e6e8533f5822ca040100fb38176db7c5d0 (diff)
downloadlibpinyin-2c7b0915ced93c79938826e05922f4230c94d332.tar.gz
libpinyin-2c7b0915ced93c79938826e05922f4230c94d332.tar.xz
libpinyin-2c7b0915ced93c79938826e05922f4230c94d332.zip
update ngseg
Diffstat (limited to 'utils/segment/ngseg.cpp')
-rw-r--r--utils/segment/ngseg.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/utils/segment/ngseg.cpp b/utils/segment/ngseg.cpp
index ae87305..96e6588 100644
--- a/utils/segment/ngseg.cpp
+++ b/utils/segment/ngseg.cpp
@@ -113,9 +113,16 @@ int main(int argc, char * argv[]){
const char * bin_file = pinyin_phrase_files[i];
if (NULL == bin_file)
continue;
- gchar * filename = g_build_filename("..", "..", "data", bin_file,NULL);
+
+ gchar * filename = g_build_filename("..", "..", "data",
+ bin_file, NULL);
chunk = new MemoryChunk;
- chunk->load(filename);
+ bool retval = chunk->load(filename);
+ if (!retval) {
+ fprintf(stderr, "open %s failed!\n", bin_file);
+ exit(ENOENT);
+ }
+
phrase_index.load(i, chunk);
g_free(filename);
}