| 1 | #!/bin/bash |
| 2 | |
| 3 | # Check that we don't get debug symbols [#@] on some test texts. |
| 4 | |
| 5 | set -e -u |
| 6 | |
| 7 | cd "$(dirname "$0")" |
| 8 | |
| 9 | |
| 10 | out=$(mktemp -t hash-count-swe-nor.XXXXXXXXXX) |
| 11 | trap 'rm -f "${out}"' EXIT |
| 12 | |
| 13 | # TODO: regressions: |
| 14 | # swe-nno nob-swe |
| 15 | for dir in swe-nob nno-swe; do |
| 16 | src=${dir%%-*} |
| 17 | |
| 18 | # cat ../texts/*."${src}".txt | apertium -f html-noent -d .. "${dir}"-dgen > "${out}" |
| 19 | # TODO: -f html-noent does rehtml or something turning dgen tags into <> |
| 20 | cat ../texts/*."${src}".txt | apertium-deshtml | apertium -f none -d .. "${dir}"-dgen > "${out}" |
| 21 | |
| 22 | current=$(grep -c '[#@]' "${out}" || true) |
| 23 | |
| 24 | if [[ "${current}" -gt 0 ]]; then |
| 25 | echo "ERROR: texts/*.${src}.txt translated through ${dir} gave debug sybols [#@]:" |
| 26 | grep -n '[#@]' "${out}" |
| 27 | exit 1 |
| 28 | fi |
| 29 | done |