eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

translate.test 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. test_phonemes() {
  3. TEST_LANG=$1
  4. EXPECTED=$2
  5. TEST_TEXT=$3
  6. echo "testing ${TEST_LANG} \"${TEST_TEXT}\""
  7. ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
  8. src/espeak-ng -xq -v ${TEST_LANG} "${TEST_TEXT}" > actual.txt
  9. echo "${EXPECTED}" > expected.txt
  10. diff expected.txt actual.txt || exit 1
  11. }
  12. # word lookup
  13. test_phonemes en " h@l'oU" "hello"
  14. # correct word stress
  15. test_phonemes en " s'VmTIN Imp'o@t@nt" "something important"
  16. # suffix rules
  17. test_phonemes lv \
  18. " 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" \
  19. "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."
  20. # A list entry that uses '$text' to map to another list entry crashes 1.49.2 multi-word support:
  21. test_phonemes en " d'eIbju:tI2d" "débuted"
  22. test_phonemes en-US " d'eIbju:t#I#d" "débuted"
  23. # bug: https://github.com/nvaccess/nvda/issues/7740
  24. test_phonemes ta " 'il." "ள்"
  25. test_phonemes my " kon'i" "7"
  26. test_phonemes ka " s'ami Sv'idi" "3 7"
  27. # bug: https://github.com/nvaccess/nvda/issues/7805
  28. test_phonemes hi " r'UcI" "रुचि"
  29. test_phonemes hi " dUk'a:n" "दुकान"
  30. test_phonemes hi " ka:n'u:n" "कानून"
  31. #----- Emoji [http://www.unicode.org/reports/tr51/tr51-12.html] -----
  32. # ED-3 - emoji_character
  33. test_phonemes en " 'e@ri:z" "♈"
  34. test_phonemes my " pru3'a2nke3DN_|_| mj@@lu3'a2mj@2tsnh,a2N_|_| nm_|n'e3DN_|_| mj@@nh,ats" "😙"
  35. test_phonemes ka " k'ots#nis g'amomx,atveli s'axe m'omQim,are t#v'alebit#" "😙"
  36. test_phonemes ka " 'imedg,ats#ru,ebuli m'agram Sv'ebis g'amomx,atveli s'axe" "😥"
  37. # TODO: Fix adjacent emoji without whitespace so the pronunciation is separated by a space.
  38. test_phonemes en " 'e@ri:zr'eInboU" "♈🌈"
  39. test_phonemes en " 'e@ri:z r'eInboU" "♈ 🌈"
  40. # multi-word emoji
  41. test_phonemes en " Ekskla#m'eIS@n kw'EstS@n m'A@k" "⁉"
  42. test_phonemes en " Ekskla#m'eIS@n kw'EstS@n m'A@k r'eInboU" "⁉ 🌈"
  43. test_phonemes en " r'oUlIN 0nD@ fl'o@ l'aafIN" "🤣" # skip words
  44. # Test replacement rules
  45. test_phonemes en " 'i:T@ d'i:m@n Ens,aIkl@p'oUdi@r- ,0n@m,at@p'oUIk a#m'i:b@ f'i:t@s l'0ft h'Ist@ri" "Æther dæmon encyclopœdia onomatopœic amœba fœtus loſt history"
  46. # bug: https://github.com/espeak-ng/espeak-ng/issues/471
  47. test_phonemes sk " sm'eju:tsa s'a tv'a:R" "☺"
  48. test_phonemes sk " bl'ax sm'eju:tsa s'a tv'a:R" "blah ☺"