diff options
author | Peng Wu <alexepico@gmail.com> | 2022-06-02 13:17:38 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2022-06-02 13:19:39 +0800 |
commit | a307b3e60b0b93310eb7efd165659d84d8752a56 (patch) | |
tree | 35a4a85df1c6a23c142362de491f9ed846234886 /utils/training/eval_correction_rate.cpp | |
parent | 706188e5080f29665ecd41791df611f4e3a6e248 (diff) | |
download | libpinyin-a307b3e60b0b93310eb7efd165659d84d8752a56.tar.gz libpinyin-a307b3e60b0b93310eb7efd165659d84d8752a56.tar.xz libpinyin-a307b3e60b0b93310eb7efd165659d84d8752a56.zip |
Use check_result macro in utils directory
Diffstat (limited to 'utils/training/eval_correction_rate.cpp')
-rw-r--r-- | utils/training/eval_correction_rate.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/training/eval_correction_rate.cpp b/utils/training/eval_correction_rate.cpp index aa33e6b..d795c0d 100644 --- a/utils/training/eval_correction_rate.cpp +++ b/utils/training/eval_correction_rate.cpp @@ -45,14 +45,14 @@ bool get_possible_pinyin(FacadePhraseIndex * phrase_index, key_index = 0; max_freq = 0; for ( size_t m = 0; m < item.get_n_pronunciation(); ++m ) { freq = 0; - assert(item.get_nth_pronunciation(m, buffer, freq)); + check_result(item.get_nth_pronunciation(m, buffer, freq)); if ( freq > max_freq ) { key_index = m; max_freq = freq; } } - assert(item.get_nth_pronunciation(key_index, buffer, freq)); + check_result(item.get_nth_pronunciation(key_index, buffer, freq)); assert(max_freq == freq); guint8 len = item.get_phrase_length(); g_array_append_vals(keys, buffer, len); @@ -105,7 +105,7 @@ bool do_one_test(PhoneticLookup<1, 1> * pinyin_lookup, get_best_match(phrase_index, pinyin_lookup, &matrix, &results); assert(1 == results.size()); - assert(results.get_result(0, guessed_tokens)); + check_result(results.get_result(0, guessed_tokens)); /* compare the results */ char * sentence = NULL; char * guessed_sentence = NULL; |