Browse Source

Add phoneme output tests.

master
Reece H. Dunn 7 years ago
parent
commit
6043d35c72
3 changed files with 25 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 1
    0
      Makefile.am
  3. 23
    0
      tests/phoneme-output.test

+ 1
- 0
.gitignore View File



tests/*.test tests/*.test
!tests/languages.test !tests/languages.test
!tests/phoneme-output.test


espeak-ng.pc espeak-ng.pc



+ 1
- 0
Makefile.am View File

check: tests/encoding.check \ check: tests/encoding.check \
tests/readclause.check \ tests/readclause.check \
tests/api.check \ tests/api.check \
tests/phoneme-output.check \
tests/languages.check tests/languages.check


##### phoneme data: ##### phoneme data:

+ 23
- 0
tests/phoneme-output.test View File

#!/bin/sh

test_phonemes() {
TEST_LANG=$1
EXPECTED=$2
TEST_TEXT=$3

echo "testing ${TEST_LANG} \"${TEST_TEXT}\""
ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
src/espeak-ng -xq -v ${TEST_LANG} "${TEST_TEXT}" > actual.txt
echo "${EXPECTED}" > expected.txt
diff expected.txt actual.txt || exit 1
}

# word lookup
test_phonemes en " h@l'oU" "hello"

# correct word stress
test_phonemes en " s'VmTIN Imp'o@t@nt" "something important"

# spelling rules for suffices (-mas, -mu)
test_phonemes lv " nev'ie:na no\`_ 'eiRo:pas v'a>lsti:m nek,ad nav p'a:Rga:jusi no\`_ 'univERsa::la:s_:_: no\` visp'aRe:jiem n'uoduok}l^iem f'inansE:tas_:_: s'iste:mas uz 'obliga:ta:s 'apdRuoSina:Sanas s'iste:mu b'eigas" "Neviena no Eiropas valstīm nekad nav pārgājusi no universālās (no visparējiem nodokļiem finansētas) sistēmas uz obligātās apdrošināšanas sistēmu Beigas."


Loading…
Cancel
Save