Browse Source

language-pronunciation.test: Support an optional message/description.

master
Reece H. Dunn 6 years ago
parent
commit
530686f2fd
1 changed files with 34 additions and 27 deletions
  1. 34
    27
      tests/language-pronunciation.test

+ 34
- 27
tests/language-pronunciation.test View File

@@ -2,60 +2,67 @@

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

echo "testing ${TEST_LANG}"
if [ "x$MESSAGE" = x- ] ; then
echo "testing ${TEST_LANG}"
else
echo "testing ${TEST_LANG} ($MESSAGE)"
fi
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
}

test_phonemes de \
test_phonemes bg "Latin characters spoken in English" \
" (en)f'Ut str'Vt(bg)" \
"foot strut"

test_phonemes de - \
" dr'Uk3 l'amp@ kOmpj'u:t3 St'Ern St'Ern@" \
"drucker lampe computer stern sterne"
test_phonemes en \

test_phonemes en - \
" k'It dr'Es tr'ap l'0t str'Vt f'Ut fl'i:s p'A:m T'O:t g'u:s n'3:s st'A@t n'O@T f'o@s kj'U@ n,i@3 skw'e@ t'3:m b'3:d h'api k'0m@ l'Et3r- Ekspl'o@ r'oUzI2z r'abIt f'eIs pr'aIs tS'OIs g'oUt m'aUT b'aaT kl'0T m'Ili@n dI2v'aIdI2d" \
"kit dress trap lot strut foot fleece palm thought goose nurse start north force cure near square term bird happy comma letter explore roses rabbit face price choice goat mouth bath cloth million divided"
test_phonemes en-029 \
test_phonemes en-029 - \
" k'It dr'Es tr'ap l'0t str'Vt f'Ut fl'i:s p'A:m t['O:t g'u:s n'3:s st'A@t n'O@t[ f'o@s kj'o@ n,i@3 skw'e@ t'3:m b'3:d h'api k'0ma# l'Eta# Ekspl'o@ r'oUzI2z r'abIt f'eIs pr'aIs tS'OIs g'oUt m'aUt[ b'aat[ kl'0t[ m'Ili@n dI2v'aIdI2d" \
"kit dress trap lot strut foot fleece palm thought goose nurse start north force cure near square term bird happy comma letter explore roses rabbit face price choice goat mouth bath cloth million divided"
test_phonemes en-GB-scotland \
test_phonemes en-GB-scotland - \
" k'It dr'Es tr'ap l'0t str'Vt f'Ut fl'i:s p'A:m T'O:t g'u:s n'VRs st'A@rt n'O@rT f'o@rs kj'U@ n,i@3r skw'e@r t'3:m b'IRd h'api k'0mV l'Et@r- Ekspl'o@r r'oUzI2z r'abIt f'eIs pr'aIs tS'OIs g'oUt m'aUT b'aaT kl'0T m'Ili@n d'I2vaId,I2d" \
"kit dress trap lot strut foot fleece palm thought goose nurse start north force cure near square term bird happy comma letter explore roses rabbit face price choice goat mouth bath cloth million divided"
test_phonemes en-GB-x-gbclan \
test_phonemes en-GB-x-gbclan - \
" k'It dr'Es tr'ap l'0t str'Vt f'Ut fl'i:s p'A:m T'O:t g'u:s n'3:s st'A@t n'O@T f'o@s kj'U@ n,i@3 skw'e@ t'3:m b'3:d h'apI2 k'0m@ l'Et3r- Ekspl'o@ r'oUzI2z r'abIt f'eIs pr'aIs tS'OIs g'oUt m'aUT b'aaT kl'0T m'Ili@n dI2v'aIdI2d" \
"kit dress trap lot strut foot fleece palm thought goose nurse start north force cure near square term bird happy comma letter explore roses rabbit face price choice goat mouth bath cloth million divided"
test_phonemes en-GB-x-gbcwmd \
test_phonemes en-GB-x-gbcwmd - \
" k'It dr'Es tr'ap l'0t str'Vt f'Ut fl'i:s p'A:m T'O:t g'u:s n'3:s st'A@t n'O@T f'O@s kj'U@ n,i@3 skw'e@ t'3:m b'3:d'api k'0m@ l'Et3r- Ekspl'O@ r'oUzI2z r'abIt f'eIs pr'aIs tS'OIs g'oUt m'aUT b'aaT kl'0T m'Ili@n dI2v'aIdI2d" \
"kit dress trap lot strut foot fleece palm thought goose nurse start north force cure near square term bird happy comma letter explore roses rabbit face price choice goat mouth bath cloth million divided"
test_phonemes en-GB-x-rp \
test_phonemes en-GB-x-rp - \
" k'It dr'Es tr'ap l'0t str'Vt f'Ut fl'i:s p'A:m T'O:t g'u:s n'3:s st'A@t n'O@T f'O@s kj'U@ n,i@3 skw'e@ t'3:m b'3:d h'api k'0ma# l'Eta#r- Ikspl'O@ r'oUzI2z r'abIt f'eIs pr'aIs tS'OIs g'oUt m'aUT b'aaT kl'0T m'Ili@n dI2v'aIdI2d" \
"kit dress trap lot strut foot fleece palm thought goose nurse start north force cure near square term bird happy comma letter explore roses rabbit face price choice goat mouth bath cloth million divided"
test_phonemes en-US \
test_phonemes en-US - \
" k'It dr'Es tr'ap l'0t str'Vt f'Ut fl'i:s p'A:m T'O:t g'u:s n'3:s st'A@t n'O@T f'o@s kj'U@ n,i@3 skw'e@ t'3:m b'3:d h'api k'0m@ l'Et#3r- Ekspl'o@ r'oUzI#z r'abIt f'eIs pr'aIs tS'OIs g'oUt m'aUT b'aaT kl'O2T m'Ili@n dI#v'aIdI#d" \
"kit dress trap lot strut foot fleece palm thought goose nurse start north force cure near square term bird happy comma letter explore roses rabbit face price choice goat mouth bath cloth million divided"
test_phonemes ja \

test_phonemes fa "Latin characters spoken in English" \
" (en)f'Ut str'Vt(fa)" \
"foot strut"

test_phonemes ja "Hiragana" \
" k'a k'i k'u k'e k'o" \
"か き く け こ"
test_phonemes lv \

test_phonemes ka "Latin characters spoken in English" \
" (en)f'Ut str'Vt(ka)" \
"foot strut"

test_phonemes lv - \
" nev'ie:na nuo\`_ 'eiRo:pas v'al>sti:m nek,ad nav p'a:Rga:jusi nuo\`_ 'univERsa:la:s_:_: nuo\` v'ispa:Re: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 vispārējiem nodokļiem finansētas) sistēmas uz obligātās apdrošināšanas sistēmu Beigas."

test_phonemes ru \
test_phonemes ru "Cyrillic" \
" 'Ab;i ab;'8 'AbjE 'Ab;I 'Abji 'Ap; 'Ab;u\" 'Ab;V" \
"абе абё абє аби абї абь абю абя"

# Languages with non-Latin characters fall back to en when speaking Latin characters.
# TODO: Include words in their native script and move to the main tests above.

test_phonemes bg \
" (en)f'Ut str'Vt(bg)" \
"foot strut"
test_phonemes fa \
" (en)f'Ut str'Vt(fa)" \
"foot strut"
test_phonemes ka \
" (en)f'Ut str'Vt(ka)" \
"foot strut"

Loading…
Cancel
Save