File: translate.test

package info (click to toggle)
espeak-ng 1.50%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 60,232 kB
  • sloc: ansic: 44,530; java: 4,005; xml: 1,605; makefile: 1,055; python: 1,020; sh: 573; javascript: 383; cpp: 300
file content (70 lines) | stat: -rwxr-xr-x 2,674 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/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"

# suffix rules
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."

# A list entry that uses '$text' to map to another list entry crashes 1.49.2 multi-word support:
test_phonemes en "d'eIbju:tI2d" "débuted"
test_phonemes en-US "d'eIbju:t#I#d" "débuted"

# bug: https://github.com/nvaccess/nvda/issues/7740
test_phonemes ta "'il." "ள்"
test_phonemes my "kon'i" "7"
test_phonemes ka "s'ami Sv'idi" "3 7"

# bug: https://github.com/nvaccess/nvda/issues/7805
test_phonemes hi "r'UcI" "रुचि"
test_phonemes hi "dUk'a:n" "दुकान"
test_phonemes hi "ka:n'u:n" "कानून"

# A deleted phoneme at the start of a word should preserve the sourceix property.
test_phonemes en-GB-x-gbcwmd "aI 'av" "I have"

# A deleted phonSWITCH should preserve the sourceix property of the deleted phoneme.
test_phonemes hyw "'a g@rn'am" "A Կրնամ"

test_phonemes en "'eI
b'i: s'i:
d'i:
'i:
'Ef" "A. B C, D. E: F."

#----- Emoji [http://www.unicode.org/reports/tr51/tr51-12.html] -----

# ED-3 - emoji_character
test_phonemes en "'e@ri:z" "♈"
test_phonemes my "pru3'a2nke3DN_|_| mj@@lu3'a2mj@2tsnh,a2N_|_| nm_|n'e3DN_|_| mj@@nh,ats" "😙"
test_phonemes ka "k'ots#nis g'amomx,atveli s'axe m'omQim,are t#v'alebit#" "😙"
test_phonemes ka "'imedg,ats#ru,ebuli m'agram Sv'ebis g'amomx,atveli s'axe" "😥"
# TODO: Fix adjacent emoji without whitespace so the pronunciation is separated by a space.
test_phonemes en "'e@ri:zr'eInboU" "♈🌈"
test_phonemes en "'e@ri:z r'eInboU" "♈ 🌈"

# multi-word emoji
test_phonemes en "Ekskla#m'eIS@n kw'EstS@n m'A@k" "⁉"
test_phonemes en "Ekskla#m'eIS@n kw'EstS@n m'A@k r'eInboU" "⁉ 🌈"
test_phonemes en "r'oUlIN 0nD@ fl'o@ l'aafIN" "🤣" # skip words

# bug: https://github.com/espeak-ng/espeak-ng/issues/471
test_phonemes sk "sm'eju:tsa s'a tv'a:R" "☺"
test_phonemes sk "bl'ax sm'eju:tsa s'a tv'a:R" "blah ☺"