summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/segment/ngseg.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/segment/ngseg.cpp b/utils/segment/ngseg.cpp
index 1e3f6c5..87814bb 100644
--- a/utils/segment/ngseg.cpp
+++ b/utils/segment/ngseg.cpp
@@ -69,6 +69,15 @@ bool deal_with_segmentable(GArray * current_utf16){
g_phrase_lookup->convert_to_utf8(results, "\n", result_string);
if (result_string)
printf("%s\n", result_string);
+ else {
+ char * result_string = g_utf16_to_utf8
+ ( (utf16_t *) current_utf16->data, current_utf16->len,
+ NULL, NULL, NULL);
+ fprintf(stderr, "Un-segmentable sentence encountered:%s.\n",
+ result_string);
+ g_array_free(results, TRUE);
+ return false;
+ }
g_array_free(results, TRUE);
g_free(result_string);
return true;