Make alignment case-insensitive for gold

This commit is contained in:
Matthew Honnibal 2017-06-04 20:26:42 -05:00
parent fc4dd62e84
commit ebb6c49cd5

View File

@ -89,8 +89,8 @@ def _min_edit_path(cand_words, gold_words):
# TODO: Fix this --- just do it properly, make the full edit matrix and # TODO: Fix this --- just do it properly, make the full edit matrix and
# then walk back over it... # then walk back over it...
# Preprocess inputs # Preprocess inputs
cand_words = [punct_re.sub('', w) for w in cand_words] cand_words = [punct_re.sub('', w).lower() for w in cand_words]
gold_words = [punct_re.sub('', w) for w in gold_words] gold_words = [punct_re.sub('', w).lower() for w in gold_words]
if cand_words == gold_words: if cand_words == gold_words:
return 0, ''.join(['M' for _ in gold_words]) return 0, ''.join(['M' for _ in gold_words])