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 3.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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'alsti: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. # s at the end of abbreviations
  24. # https://github.com/espeak-ng/espeak-ng/issues/706
  25. test_phonemes en ",aIb,i:;'Em m'It 'Ib@mz m'Its ,aIb,i:;'Em ,Em,aIt'i:; ,eIp,i:;'eItS s,i:;,i:;'Es ,aIt,i:;'Eks ,aIb,i:;'Emz ,Em,aIt'i:z ,eIp,i:;'eItSIz s,i:;,i:;'EsIz ,aIt,i:;'EksIz" "ibm mit ibms mits IBM MIT APH CES ITX IBMs MIT's APHs CES's ITXs"
  26. test_phonemes lv "'ibm m'it 'ibm-s m'its 'ibm m'it 'aph ts'Es 'it_ks 'ibm-s m'its 'aphs ts'Ess 'it_kss" "ibm mit ibms mits IBM MIT APH CES ITX IBMs MIT's APHs CES's ITXs"
  27. test_phonemes ru "(en),aIb,i:;'Em m'It 'Ib@mz m'Its ,aIb,i:;'Em ,Em,aIt'i:; ,eIp,i:;'eItS s,i:;,i:;'Es ,aIt,i:;'Eks 'Ib@mz m'Its 'afz s'EI2zI2z 'ItEksz(ru)" "ibm mit ibms mits IBM MIT APH CES ITX IBMs MIT's APHs CES's ITXs"
  28. # bug: https://github.com/nvaccess/nvda/issues/7740
  29. test_phonemes ta "'il." "ள்"
  30. test_phonemes my "kon'i" "7"
  31. test_phonemes ka "s'ami Sv'idi" "3 7"
  32. # bug: https://github.com/nvaccess/nvda/issues/7805
  33. test_phonemes hi "r'UcI" "रुचि"
  34. test_phonemes hi "dUk'a:n" "दुकान"
  35. test_phonemes hi "ka:n'u:n" "कानून"
  36. # A deleted phoneme at the start of a word should preserve the sourceix property.
  37. test_phonemes en-GB-x-gbcwmd "aI 'av" "I have"
  38. # A deleted phonSWITCH should preserve the sourceix property of the deleted phoneme.
  39. test_phonemes hyw "'a g@rn'am" "A Կրնամ"
  40. test_phonemes en "'eI
  41. b'i: s'i:
  42. d'i:
  43. 'i:
  44. 'Ef" "A. B C, D. E: F."
  45. # Handling of english acronym + genitive without breaking simple quote
  46. test_phonemes en "hi: s'Ed
  47. aI w0z b'O@n InD@ j,u:,Es'eI z_:_: and l'Eft" "He said : I was born in the u.s.a.'s and left."
  48. test_phonemes en "hi: s'Ed
  49. h@l'oU
  50. aIa#m b'ak
  51. and l'Eft" "He said : 'Hello, I am back.' and left."
  52. #----- Emoji [http://www.unicode.org/reports/tr51/tr51-12.html] -----
  53. # ED-3 - emoji_character
  54. test_phonemes en "'e@ri:z" "♈"
  55. test_phonemes my "pru3'a2nke3DN_|_| mj@@lu3'a2mj@2tsnh,a2N_|_| nm_|n'e3DN_|_| mj@@nh,ats" "😙"
  56. test_phonemes ka "k'ots#nis g'amomx,atveli s'axe m'omQim,are t#v'alebit#" "😙"
  57. test_phonemes ka "'imedg,ats#ru,ebuli m'agram Sv'ebis g'amomx,atveli s'axe" "😥"
  58. # TODO: Fix adjacent emoji without whitespace so the pronunciation is separated by a space.
  59. test_phonemes en "'e@ri:zr'eInboU" "♈🌈"
  60. test_phonemes en "'e@ri:z r'eInboU" "♈ 🌈"
  61. # multi-word emoji
  62. test_phonemes en "Ekskla#m'eIS@n kw'EstS@n m'A@k" "⁉"
  63. test_phonemes en "Ekskla#m'eIS@n kw'EstS@n m'A@k r'eInboU" "⁉ 🌈"
  64. test_phonemes en "r'oUlIN 0nD@ fl'o@ l'aafIN" "🤣" # skip words
  65. # bug: https://github.com/espeak-ng/espeak-ng/issues/471
  66. test_phonemes sk "sm'eju:tsa s'a tv'a:R" "☺"
  67. test_phonemes sk "bl'ax sm'eju:tsa s'a tv'a:R" "blah ☺"