Commit Graph
342 Commits
Author SHA1 Message Date
Lucas Werkmeister 2d47c32ba9 Add Quenya ⟨hl⟩ and Sindarin ⟨lh⟩
Both represent a “voiceless L”; Appendix E of The Lord of the Rings
notes that the Quenya ⟨hl⟩ was pronounced like /l/ by the Third Age, but
for now we reproduce the original pronunciation. (Maybe we can later use
conditional rules for different pronunciations, but I think for now I
won’t go down that road.)
2021-07-18 13:28:03 +02:00
Lucas Werkmeister 438be8ed50 Change short Elvish ⟨i⟩ from [[i]] to [[I]]
The B-side of the album Poems and Songs of Middle Earth begins with a
reading of the Sindarin poem A Elbereth Gilthoniel by J.R.R. Tolkien
himself, and in this recording, as best I can tell, he always pronounces
short i (i.e. ⟨i⟩, not ⟨í⟩ or ⟨î⟩) as /ɪ/ rather than /i/, regardless of
stress; for instance, the word “silivren” has the same i-sound twice (it
is not “silívren”). I believe this means that we should use the phoneme
[[I]], not [[i]], for ⟨i⟩ (in both Quenya and Sindarin).
2021-07-18 13:28:03 +02:00
Lucas Werkmeister 8f9c458493 Fix Quenya ⟨ch⟩ pronunciation
Appendix E of The Lord of the Rings describes it as “the sound heard in
bach (in German or Welsh)”; I think that means [χ], not [x] (voiceless
uvular rather than velar fricative), and out of the base1 phonemes,
[[X]] is closer to that than [[x]]. (The German phonemes redefine [[x]]
to be closer to [[X]], if I’m not mistaken, but I don’t think we need
that. Note also that we actually need [[x]] for Quenya ⟨ht⟩.)
2021-07-18 13:28:03 +02:00
Lucas Werkmeister 1c4aafbbfa Add Quenya ⟨ht⟩ digraph
According to Appendix E of The Lord of the Rings, “[t]he Quenya
combination ht has the sound of cht, as in German echt, acht”. As echt
and acht do not have the same cht sound in German, I assume this means
that they are allophones in Quenya just as in German, and ⟨ht⟩ means
[çt] after front vowels but [xt] after back vowels. Add tests for both:
Telumehtar, the Quenya name of the star Orion, is given in Appendix E as
an example of ⟨ht⟩; Mahtar is the father of Nerdanel, wife of Fëanor.
2021-07-18 13:28:03 +02:00
Lucas Werkmeister 74ec56a192 Add Sindarin “muta cum liquida” words to sjn_list
According to the regular stress rules from Appendix E of The Lord of the
Rings, all three of these words should be stressed on the penultimate
(second) syllable, since that syllable is followed by two consonants;
however, the way they are used in poems suggests they should actually be
stressed on the antepenultimate (first) syllable (example: “in IMlaDRIS
it DWELLS”). According to Concerning Stress Placement In Sindarin [1],
this can be attributed to a hypothetical “muta cum liquida” rule like in
Latin, where some syllables count as light even if they’re followed by
two consonants, because both consonants belong to the following syllable
(e.g. IM-la-dris instead of im-LAD-ris). However, the rule is apparently
not applied systematically: according to [2], in another poem the word
“nogothrim”, which is quite similar in structure to “Nargothrond”, is
clearly stressed on the penultimate syllable. For this reason, we don’t
try to define the “muta cum liquida” rule in sjn_rules (or qya_rules),
but only add the three names Imladris, Menegroth and Nargothrond as
exceptions to the sjn_list.

[1]: https://menegroth.github.io/stress-in-sindarin.html
[2]: https://mildred-of-midgard.dreamwidth.org/158375.html#comment-cmt49575
2021-07-18 13:28:03 +02:00
Lucas Werkmeister 9ac1a5bffb Fix treatment of diphthongs for stress in Elvish
Stress is determined based on the syllables, not the vowels, so the
diphthongs need to count as a single syllable. If there is a diphthong
at the end of a word, the penultimate syllable can still be unstressed
if it is light. (The name of Arvedui, last king of Arthedain, is one
example of this that I could think of, but I’m sure it’s not the only
one.)
2021-07-18 13:28:03 +02:00
Lucas Werkmeister 4e6ebdbfb6 Velarize [n] to [ŋ] before velar stops in Elvish
I’m not aware of any statement by Tolkien to this effect, but it just
seems natural to me, and the [ŋ] is at least found in the Omikhleia
Sindarin dictionary [1] (e.g. entry tinc, [tˈiŋk]).

Based on a similar phoneme rule in ph_english.

[1]: https://www.jrrvf.com/hisweloke/sindar/index.html
2021-07-18 13:28:03 +02:00
Lucas Werkmeister ca2ca4c5cb Add Sindarin ⟨ae⟩, ⟨ai⟩, ⟨oe⟩, ⟨ui⟩ diphthongs
For ⟨ae⟩, we used to use the Latin [[aI]] phoneme, which sounds like
/ae/. Call that phoneme [[aE]] for us and introduce a separate [[aI]]
one, which sounds more like /ai/ (since Sindarin has both, and they’re
supposed to sound different, though Appendix E of The Lord of the Rings
notes that there is nothing closely corresponding to ⟨ae⟩ in English and
that it may be pronounced like ⟨ai⟩). Furthermore, for ⟨oe⟩, just remove
the TODO – the Latin phoneme is called [[OI]] but sounds more like /oe/
than /oi/, so it’s actually just fine for our purposes. Finally, the
⟨ui⟩ diphthong is copied from Finnish, just like in Quenya.
2021-07-18 13:28:02 +02:00
Lucas Werkmeister 0928b3a432 Add more Quenya test cases
I had left out test cases with ⟨qu⟩ and/or ⟨y⟩ earlier, but it looks
like there wasn’t actually any need to do that, they work just fine.
2021-07-18 13:27:26 +02:00
Lucas Werkmeister c6e6f60154 Make ph between vowels long in Elvish
According to Appendix E of The Lord of the Rings, ⟨ph⟩ stands for /f/
when final (because ⟨f⟩ is pronounced as /v/ in that position), and
otherwise is used instead of ⟨f⟩ either because it’s derived from ⟨p⟩
(in which case it’s presumably pronounced just like ⟨f⟩), or to
represent an especially long /f/. We can’t really tell which case we
have, but from the Omikhleia Sindarin dictionary [1], it appears that
all the long ⟨ph⟩’s are between two vowels, and all the short ones have
at least one adjacent consonant, so let’s use that as a rule and hope it
works out. (The Ambar Eldaron Quenya dictionary [2] is less easily
searchable, so I’m just hoping that this rule works reasonably well for
both languages.)

[1]: https://www.jrrvf.com/hisweloke/sindar/index.html
[2]: https://ambar-eldaron.com/telechargements/quenya-engl-A4.pdf
2021-07-18 13:27:26 +02:00
Lucas Werkmeister f25fda6cd8 Define some Elvish diphthongs
Not all of the diphthongs in Quenya and Sindarin are defined in the
Latin phonemes, and for now we’re sticking to those, so some diphthongs
just get TODOs for now. Also, we’re temporarily using the same phoneme
for ⟨ae⟩/⟨ai⟩ and ⟨oe⟩/⟨oi⟩, which should really be different (though
Appendix E of The Lord of the Rings notes that ⟨ae⟩ and ⟨oe⟩ don’t have
close English equivalents, and that they “may be pronounced as ai, oi”).
2021-07-18 13:27:26 +02:00
Lucas Werkmeister ee7e057821 Fix extra-long vowels in Elvish languages
A circumflex “specially prolonged” vowels; according to Appendix E of
The Lord of the Rings, only in Sindarin, but the Ambar Eldaron Quenya
Dictionary [1] also has some very few circumflex words (sû, lîs), so
let’s support the circumflex in Quenya as well. Marking extra-long
vowels with two colons seems to work well and is also done in several
other languages.

[1]: https://ambar-eldaron.com/telechargements/quenya-engl-A4.pdf
2021-07-18 13:27:26 +02:00
Lucas Werkmeister db971c8201 Fix long vowels in Elvish languages
Long vowels, marked with an acute accent or a circumflex, are longer
than short vowels (duh) and always make a heavy syllable (i.e. we don’t
include the rules to move stress to the previous syllable). In Quenya,
⟨é⟩ and ⟨ó⟩ are “tenser and ‘closer’” than the short vowels, according
to Appendix E of The Lord of the Rings, while in Sindarin they’re
supposed to be the same; the phonemes we inherit from Latin seem to
reproduce this reasonably well for Quenya, and for now we use them for
Sindarin too, which works nicely for the most common Sindarin word with
a long o, “Lothlórien” (because Lórien is actually a Quenya name, and
therefore I assume *that* ⟨ó⟩ should actually be /o/ and not /ɔ/). I
might adjust the phonemes later (at which point Lothlórien will
presumably have to go in sjn_list).
2021-07-18 13:27:26 +02:00
Lucas Werkmeister d201e17418 Fix stress of Elvish ⟨ch⟩, ⟨dh⟩, ⟨th⟩
In Elvish languages, ⟨ch⟩, ⟨dh⟩, and ⟨th⟩ count as single consonants for
the purposes of stress, since they represent single letters in the
original scripts. The easiest way to implement this is to replace them
with single letters at the beginning – ⟨ð⟩ for ⟨dh⟩ and ⟨þ⟩ for ⟨th⟩ are
natural, and ⟨x⟩ for ⟨ch⟩ also makes some sense, though it means we need
to replace real ⟨x⟩ first (it’s not mentioned in Appendix E of The Lord
of the Rings, but does occur in some Quenya words, notably Helcaraxë).
Real ⟨x⟩ is pronounced like /ks/, but of course we need to spell that as
⟨cs⟩, since ⟨k⟩ does not occur in Elvish languages.
2021-07-18 13:27:26 +02:00
Lucas Werkmeister 35defe2c77 Add first tests for Elvish languages
This consists of the test cases from my Tolkien Stress Analyser [1],
minus the ones that aren’t properly handled yet for various reasons. I
expect to add more words here with most future commits for Elvish
languages.

[1]: https://github.com/lucaswerkmeister/tolkien-stress/blob/gh-pages/test/index.test.mjs
2021-07-18 13:27:26 +02:00
Valdis Vitolins 0f48665868 Exclude Android libraries from executable bit test 2021-07-09 12:33:37 +03:00
agonzalezd fa476bb239 eu: Updated intervocalic j phoneme in Basque 2021-06-29 15:14:43 +03:00
agonzalezd 1320bfe5f9 eu: Passed test/language-pronunciation.test, removed hardcoded stress_rule in Basque 2021-06-29 15:14:38 +03:00
Reece H. Dunn 5791bf28de Fix -Wunused-parameter warnings. 2021-05-30 17:10:25 +01:00
Valdis Vitolins 40b78f5183 Add handling of Ignore message for all test functions 2021-05-23 14:58:17 +03:00
Valdis Vitolins f6d092a9c1 Merge pull request #942 2021-05-18 23:26:07 +03:00
Valdis Vitolins 17e6bd0672 Print out short message instead of long output for tests with long test string 2021-05-16 23:38:22 +03:00
Philippe Antoine 956dd18202 fuzzer: test env variable ESPEAK_DATA_PATH
before overwriting it with a default value for oss-fuzz
2021-05-16 21:25:20 +02:00
Christopher Brannon 8810fa330e Fix another out-of-bounds read in SSML parsing.
A malformed tag like <foo could cause espeak to read past
the end of the string.
2021-05-15 15:19:57 -07:00
Juho Hiltunen 2a7080f411 Merge pull request #932 2021-05-15 21:17:50 +03:00
Christopher Brannon 2d7286d571 Fix out-of-bounds read when processing malformed SSML. 2021-05-15 21:12:59 +03:00
Philippe Antoine 0a713d52bb fuzz: use binary directory for ESPEAK_DATA_PATH
instead of current working directory
so, the fuzzer can be launched from anywhere
2021-05-11 14:59:23 +02:00
Reece H. Dunn bcf3b5fec2 Ignore the ucd-tools test executables in the non-executable file test. 2021-05-04 18:50:40 +01:00
Reece H. Dunn acb7248562 Fix running the non-executable-files-with-executable-bit test. 2021-05-04 18:45:11 +01:00
Philippe Antoine 24bfbcfeca Oss-fuzz integration
- fix a buffer overflow in ucd_tolower leading to failure when
compiling with address sanitizer
- force the use of C++ compiler for espeak-ng
- adding a malloc to have a null-terminated string in the fuzz target
- setting (but not overwriting) ESPEAK_DATA_PATH environment
variable inside the fuzz target
2021-05-04 13:12:42 +02:00
Valdis Vitolins 899b268468 Add OPTIONS argument to test_phon() and use it instead of test_commandlineoptions() 2021-04-06 18:01:19 +03:00
Valdis Vitolins d15de8cd78 Fix introduced bugs during refactorization 2021-04-06 17:45:28 +03:00
Valdis Vitolins 5f6b5c8093 Make output more similar to the output before refactorization 2021-04-06 17:44:40 +03:00
Valdis Vitolins 4588258cd7 Make test_replace() similar to other functions 2021-04-06 17:01:23 +03:00
Valdis Vitolins df8dd607df Replace test_lang() and test_voice() with test_wav() and test_phwav() which uses test_wav() 2021-04-06 16:52:26 +03:00
Valdis Vitolins 842cd3e25e Replace test_phonemes(), test_phonemes1() and test_dict() with single test_phon() 2021-04-06 16:28:23 +03:00
Valdis Vitolins 43dee60c33 Make test_dict the same as test_phonemes 2021-04-06 16:10:26 +03:00
Valdis Vitolins e14b567d77 Merge MESSAGE and TEST_BROKEN arguments 2021-04-06 15:57:58 +03:00
Valdis Vitolins 6fcb110b83 Move MESSAGE argument as 4th, to make arguments similar to other functions 2021-04-06 00:31:42 +03:00
Valdis Vitolins ec552d2566 Move common functions into common script 2021-04-05 23:24:06 +03:00
Valdis Vitolins 2954e498ca Change shell to sh as it is more common 2021-04-05 21:53:26 +03:00
Juho Hiltunen c4740b3053 New language option lowercaseSentence
When set in a language file, a period followed by a lower case letter is
detected as end of sentence. Normal behavior is to require a capital
letter.
2021-04-05 19:29:18 +03:00
Reece H. Dunn e6880b27de [#891]: Fix building the Arabic dictionary on windows. 2021-03-24 18:07:39 +00:00
Reece H. Dunn a0b0f58cf5 [#864]: Fix installing the Japanese language on windows. 2021-03-24 17:58:55 +00:00
Juho Hiltunen 2d9ef5b5fc tests: test for mbrola voice combined with a voice variant 2021-03-20 08:37:26 +02:00
Juho Hiltunen 75ea4b0bdf Tests: add tests for voice variants 2021-03-10 21:19:55 +02:00
Valdis Vitolins 7b160873f7 tr: fix test for changed pronunciation 2021-03-02 22:17:57 +02:00
Juho Hiltunen c62921ae0b tests: add tests for ssml <prosody> and <audio>
SSML logic has a bug (#410) where speech parameters are not changed when there's a
sentence elogic nd. The prosody bug test should fail.
2021-02-27 20:24:44 +02:00
Juho Hiltunen 4838b35602 Tests: new test file for command line options
This is intended for testing command line options such as -k 2, --punct
and so on.
2021-01-26 20:57:57 +02:00
Juho Hiltunen a36f5573d2 Tests: new test collection for dictionary files.
The file is intended for everything mentioned in docs/dictionary.md.
2021-01-26 20:57:34 +02:00