From 7c8cfebb06e250dd3014d9733130e3d2b36124e1 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 15 Aug 2016 17:21:27 +0800 Subject: fixes compute_pronunciation_possibility function --- src/storage/phonetic_key_matrix.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/storage') diff --git a/src/storage/phonetic_key_matrix.cpp b/src/storage/phonetic_key_matrix.cpp index 8f8bd4a..da8d06f 100644 --- a/src/storage/phonetic_key_matrix.cpp +++ b/src/storage/phonetic_key_matrix.cpp @@ -497,8 +497,10 @@ gfloat compute_pronunciation_possibility(PhoneticKeyMatrix * matrix, PhraseItem & item){ assert(end < matrix->size()); - assert(matrix->get_column_size(start) > 0); - assert(matrix->get_column_size(end) > 0); + if(matrix->get_column_size(start) <= 0) + return 0.; + if(matrix->get_column_size(end) <= 0) + return 0.; g_array_set_size(cached_keys, 0); return compute_pronunciation_possibility_recur -- cgit