summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-02-10 15:23:40 +0800
committerPeng Wu <alexepico@gmail.com>2017-02-10 15:23:40 +0800
commit6f1fe4739fb5875cec915cd14c920173e143bba3 (patch)
tree35052666c42352341b8a4cd7fb43ef65a7a6b94c /utils
parent997085b873a2b1395a309bdebf52a3ca702087e5 (diff)
downloadlibpinyin-6f1fe4739fb5875cec915cd14c920173e143bba3.zip
libpinyin-6f1fe4739fb5875cec915cd14c920173e143bba3.tar.gz
libpinyin-6f1fe4739fb5875cec915cd14c920173e143bba3.tar.xz
fixes class ForwardPhoneticConstraints
Diffstat (limited to 'utils')
-rw-r--r--utils/training/eval_correction_rate.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/training/eval_correction_rate.cpp b/utils/training/eval_correction_rate.cpp
index d49dff3..5983cca 100644
--- a/utils/training/eval_correction_rate.cpp
+++ b/utils/training/eval_correction_rate.cpp
@@ -60,7 +60,8 @@ bool get_possible_pinyin(FacadePhraseIndex * phrase_index,
return true;
}
-bool get_best_match(PhoneticLookup<1> * pinyin_lookup,
+bool get_best_match(FacadePhraseIndex * phrase_index,
+ PhoneticLookup<1> * pinyin_lookup,
PhoneticKeyMatrix * matrix,
NBestMatchResults * results) {
/* prepare the prefixes for get_nbest_match. */
@@ -69,7 +70,7 @@ bool get_best_match(PhoneticLookup<1> * pinyin_lookup,
g_array_append_val(prefixes, sentence_start);
/* initialize constraints. */
- ForwardPhoneticConstraints constraints;
+ ForwardPhoneticConstraints constraints(phrase_index);
constraints.validate_constraint(matrix);
bool retval = pinyin_lookup->get_nbest_match(prefixes, matrix, &constraints, results);
@@ -101,7 +102,7 @@ bool do_one_test(PhoneticLookup<1> * pinyin_lookup,
PhoneticKeyMatrix matrix;
NBestMatchResults results;
fill_matrix(&matrix, keys, key_rests, keys->len);
- get_best_match(pinyin_lookup, &matrix, &results);
+ get_best_match(phrase_index, pinyin_lookup, &matrix, &results);
assert(1 == results.size());
assert(results.get_result(0, guessed_tokens));