From a4901dd10796363b9f74db459965c8a9d4628ddb Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 6 Sep 2011 12:04:48 +0800 Subject: fixes compile and a bug --- tests/test_pinyin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/test_pinyin.cpp') diff --git a/tests/test_pinyin.cpp b/tests/test_pinyin.cpp index ce00f14..1009adb 100644 --- a/tests/test_pinyin.cpp +++ b/tests/test_pinyin.cpp @@ -46,9 +46,11 @@ int main(int argc, char * argv[]){ break; pinyin_parse_more_fulls(context, linebuf, pinyin_keys); - char * sentence = NULL; + pinyin_update_constraints(context, pinyin_keys, constraints); pinyin_get_guessed_tokens(context, pinyin_keys, constraints, match_results); + + char * sentence = NULL; pinyin_get_sentence (context, match_results, &sentence); printf("%s\n", sentence); g_free(sentence); @@ -61,7 +63,6 @@ int main(int argc, char * argv[]){ pinyin_free_auxiliary_arrays (context, &pinyin_keys, &constraints, &match_results); pinyin_fini(context); - g_array_free(pinyin_keys, TRUE); free(linebuf); return 0; } -- cgit