translate.test 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # bug: https://github.com/nvaccess/nvda/issues/7740
  17. test_phonemes ta " 'il." "ள்"
  18. test_phonemes my " kon'i" "7"
  19. test_phonemes ka " s'ami Sv'idi" "3 7"
  20. # bug: https://github.com/nvaccess/nvda/issues/7805
  21. test_phonemes hi " r'UcI" "रुचि"
  22. test_phonemes hi " dUk'a:n" "दुकान"
  23. test_phonemes hi " ka:n'u:n" "कानून"
  24. #----- Emoji [http://www.unicode.org/reports/tr51/tr51-12.html] -----
  25. # ED-3 - emoji_character
  26. test_phonemes en " 'e@ri:z" "♈"
  27. test_phonemes my " pru3'a2nke3DN_|_| mj@@lu3'a2mj@2tsnh,a2N_|_| nm_|n'e3DN_|_| mj@@nh,ats" "😙"
  28. test_phonemes ka " k'ots#nis g'amomx,atveli s'axe m'omQim,are t#v'alebit#" "😙"
  29. test_phonemes ka " 'imedg,ats#ru,ebuli m'agram Sv'ebis g'amomx,atveli s'axe" "😥"
  30. # TODO: Fix adjacent emoji without whitespace so the pronunciation is separated by a space.
  31. test_phonemes en " 'e@ri:zr'eInboU" "♈🌈"
  32. test_phonemes en " 'e@ri:z r'eInboU" "♈ 🌈"
  33. # multi-word
  34. test_phonemes en " Ekskla#m'eIS@n kw'EstS@n m'A@k" "⁉"
  35. test_phonemes en " Ekskla#m'eIS@n kw'EstS@n m'A@k r'eInboU" "⁉ 🌈"
  36. # A list entry that uses '$text' to map to another list entry crashes 1.49.2 multi-word support:
  37. test_phonemes en " d'eIbju:tI2d" "débuted"
  38. test_phonemes en-US " d'eIbju:t#I#d" "débuted"