mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 13:38:47 +00:00
Add a test for XML/SSML character and entity references
This commit is contained in:
+11
-2
@@ -2,12 +2,21 @@
|
||||
|
||||
test_ssml() {
|
||||
INPUT=$1
|
||||
|
||||
if [ "$2" = "punct" ]
|
||||
then
|
||||
PARAMETERS="--punct -x"
|
||||
else
|
||||
PARAMETERS="-v en-US --ipa=2"
|
||||
fi
|
||||
|
||||
echo "testing ${INPUT}"
|
||||
cp $(dirname $INPUT)/$(basename ${INPUT%.*}).expected expected.txt
|
||||
ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
|
||||
src/espeak-ng -m -q -v en-US --ipa=2 -f ${INPUT} > actual.txt
|
||||
src/espeak-ng -m -q $PARAMETERS -f ${INPUT} > actual.txt
|
||||
diff expected.txt actual.txt || exit 1
|
||||
}
|
||||
|
||||
for i in `ls tests/ssml/*.ssml` ; do test_ssml $i ; done
|
||||
for i in `ls tests/ssml/*.ssml` ; do test_ssml $i; done
|
||||
for i in `ls tests/ssml/*.ssml2` ; do test_ssml $i punct; done
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
l'EsDan_: gr'eIt@D,an_: 'amp@s,and t'Ik_: kw'oUts
|
||||
b'i: b'i:
|
||||
z'Ed z'Ed
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- SSML reference test
|
||||
Entity references < > & ' and " should be replaced in the buffer
|
||||
Character references A are translated to Unicode (65 = 'A')
|
||||
|
||||
See https://www.tutorialspoint.com/xml/xml_syntax.htm
|
||||
-->
|
||||
<speak> < > & ' " </speak>
|
||||
<speak> B B</speak>
|
||||
<speak>z z</speak>
|
||||
Reference in New Issue
Block a user