diff options
author | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2020-01-24 13:05:57 +0300 |
---|---|---|
committer | Roman Grundkiewicz <rgrundki@exseed.ed.ac.uk> | 2020-01-24 13:05:57 +0300 |
commit | 1730727b0a6da25427217bc194f534d844290a84 (patch) | |
tree | c5d3c74c513c520a45411481e282e731fa2bc21a /tests | |
parent | fe5c7e1beb1d9fca74b4e37e49f5d1e65aacf8aa (diff) |
Add test for scoring with blank lines
Diffstat (limited to 'tests')
-rw-r--r-- | tests/interface/input/blank_score.expected | 10 | ||||
-rw-r--r-- | tests/interface/input/test_score_with_blank_lines.sh | 22 | ||||
-rw-r--r-- | tests/interface/input/text_blank_lines.ref | 10 |
3 files changed, 42 insertions, 0 deletions
diff --git a/tests/interface/input/blank_score.expected b/tests/interface/input/blank_score.expected new file mode 100644 index 0000000..dd007ee --- /dev/null +++ b/tests/interface/input/blank_score.expected @@ -0,0 +1,10 @@ +-46.605667 +-123.891159 +-10.970621 +-62.273071 +-0.957520 +-41.687168 +-0.957520 +-0.957520 +-9.059074 +-15.826587 diff --git a/tests/interface/input/test_score_with_blank_lines.sh b/tests/interface/input/test_score_with_blank_lines.sh new file mode 100644 index 0000000..dcc9bab --- /dev/null +++ b/tests/interface/input/test_score_with_blank_lines.sh @@ -0,0 +1,22 @@ +#!/bin/bash -x + +##################################################################### +# SUMMARY: Re-score files with empty lines +# AUTHOR: snukky +# TAGS: emptyline sentencepiece scorer +##################################################################### + +# Exit on error +set -e + +# Remove old artifacts +rm -f blank_score.{out,diff} + +# Run marian scorer +$MRT_MARIAN/marian-scorer -c $MRT_MODELS/rnn-spm/score.yml -t text_blank_lines.{in,ref} > blank_score.out + +# Compare the output with the expected output +$MRT_TOOLS/diff.sh blank_score.out blank_score.expected > blank_score.diff + +# Exit with success code +exit 0 diff --git a/tests/interface/input/text_blank_lines.ref b/tests/interface/input/text_blank_lines.ref new file mode 100644 index 0000000..ce99aa9 --- /dev/null +++ b/tests/interface/input/text_blank_lines.ref @@ -0,0 +1,10 @@ +having said that , Parliament has reached the end of the agenda . +the Minutes of the present sitting will be subject to Parliament ' s approval at the beginning of the next part @-@ session . +Mr Manders has the floor for a procedural motion . +Mr President , I would like to take this opportunity to wish you , the Bureau and all Members , a good transition into the new year . + +I would also like , although they are absent , to mention the Commission and the Council . + + +I declare the session of the European Parliament adjourned . +( the sitting was closed at 10.50 a.m. ) |