When reading hypothesis and reference files, multi-bleu.perl uses the
chop function to remove the trailing newline character.
If one of these files happens to not end with a newline, then chop will
remove the last character of the last line (instead of the newline).
This causes the BLEU score to be slightly off from its theoretical
value.
Using the safest chomp function solves this problem, i.e. it only
removes newlines when present.
When reading hypothesis and reference files, multi-bleu.perl uses the chop function to remove the trailing newline character. If one of these files happens to not end with a newline, then chop will remove the last character of the last line (instead of the newline). This causes the BLEU score to be slightly off from its theoretical value. Using the safest chomp function solves this problem, i.e. it only removes newlines when present.