Module:la-pronunc/testcases

local tests = require "Module:UnitTests"

local to_IPA = require "Module:la-pronunc".convert_words

local Latin = require "Module:languages".getByCode "la" local function link(word) return require "Module:links".full_link { term = word, lang = Latin } end

local function format_IPA(phonemic, phonetic) return (' /%s/ [%s] ') :format(tostring(phonemic), tostring(phonetic)) end

function tests:test_all local examples = { -- spelling, Classical phonemic and phonetic, Ecclesiastical phonemic and phonetic { "ecclēsia", { "ekˈkleː.si.a", "ɛkˈkɫ̪eːs̠iä" }, { "ekˈkle.si.a", "ɛkˈklɛːs̬iä" } }, { "magnus", { "ˈmaɡ.nus", "ˈmäŋnʊs̠" }, { "ˈmaɲ.ɲus", "ˈmäɲːus" } }, { "coepī", { "ˈkoe̯.piː", "ˈkoe̯piː" }, { "ˈt͡ʃe.pi", "ˈt͡ʃɛːpi" } }, { "Caesar", { "ˈkae̯.sar", "ˈkäe̯s̠är" }, { "ˈt͡ʃe.sar", "ˈt͡ʃɛːs̬är" } }, { "adhāmō", { "adˈhaː.moː", "äd̪ˈ(ɦ)äːmoː" }, { "aˈda.mo", "äˈd̪äːmɔ" } }, "rhotic allophones (no allophony currently shown)", { "rēs", { "reːs", "reːs̠" }, {"res", "rɛs"} }, { "ferre", { "ˈfer.re", "ˈfɛrːɛ" }, {"ˈfer.re", "ˈfɛrːɛ"} }, { "corporis", { "ˈkor.po.ris", "ˈkɔrpɔrɪs̠" }, {"ˈkor.po.ris", "ˈkɔrpɔris"} }, { "inrīdeō", { "inˈriː.de.oː", "ɪnˈriːd̪eoː" }, {"inˈri.de.o", "inˈriːd̪ɛɔ"} }, { "abrumpō", { "abˈrum.poː", "äbˈrʊmpoː" }, false, }, --Not implemented yet: phrases --{ "bona rēs", { "ˈbo.na ˈreːs", "ˈbɔnäˈreːs̠" }, false, }, --{ "ācer Amor", { "ˈaː.keˈr‿amɔr", "ˈäːkɛˈrämɔɾ" }, false, }, "lateral allophones", { "similis", { "ˈsi.mi.lis", "ˈs̠ɪmɪlʲɪs̠" }, false, }, { "simile", { "ˈsi.mi.le", "ˈs̠ɪmɪɫ̪ɛ" }, false, }, { "simul", { "ˈsi.mul", "ˈs̠ɪmʊɫ̪" }, false, }, { "alga", { "ˈal.ɡa", "ˈäɫ̪ɡä" }, false, }, { "nōlle", { "ˈnoːl.le", "ˈnoːlːʲɛ" }, false, }, --Not implemented yet: phrases --{ "simul ipse", { "ˈsi.muˈl‿ip.se", "ˈs̠ɪmʊˈlʲɪpsɛ" }, false, }, --{ "difficilī argūmentō", { "difˈfi.ki.l‿ar.guːˈmen.toː", "d̪ɪfˈfɪkɪɫ̪arguːˈmɛntoː" }, false, }, "semivowels between vowels", { "majus", { "ˈmai̯.i̯us", "ˈmäi̯ːʊs̠" }, {"ˈma.jus", "ˈmäːjus"} }, { "peius", { "ˈpei̯.i̯us", "ˈpɛi̯ːʊs̠" }, {"ˈpe.jus", "ˈpɛːjus"} }, { "cuius", { "ˈkui̯.i̯us", "ˈkʊi̯ːʊs̠" }, {"ˈku.jus", "ˈkuːjus"} }, { "trāiectus", { "traːˈi̯ek.tus", "t̪räːˈi̯ɛkt̪ʊs̠" }, {"traˈjek.tus", "t̪räˈjɛkt̪us"} }, { "dēiectus", { "deːˈi̯ek.tus", "d̪eːˈi̯ɛkt̪ʊs̠" }, {"deˈjek.tus", "d̪ɛˈjɛkt̪us"} }, { "prōiectus", { "proːˈi̯ek.tus", "proːˈi̯ɛkt̪ʊs̠" }, {"proˈjek.tus", "prɔˈjɛkt̪us"} }, { "cavus", { "ˈka.u̯us", "ˈkäu̯ʊs̠" } }, { "cauus", { "ˈka.u̯us", "ˈkäu̯ʊs̠" } }, --Note: Italian words such as Baia and Febbraio have non-doubled /j/, and presumably Ecclesiastical pronunciation of majus etc. is similar. "diphthongs before vowels and word-finally", --Note: Heavy diphthongs before vowels can alternatively be analyzed as sequences of short vowel followed by -ww- or -jj- { "iūdaeus", { "i̯uːˈdae̯.us", "i̯uːˈd̪äe̯ʊs̠" }, { "juˈde.us", "juˈd̪ɛːus" } }, { "Meliboea", { "me.liˈboe̯.a", "mɛlʲɪˈboe̯ä" }, { "me.liˈbe.a", "mɛliˈbɛːä" } }, { "Agau.ē", { "aˈɡau̯.eː", "äˈɡäu̯eː" }, false }, { "catasceu.a", { "ka.tasˈkeu̯.a", "kät̪äs̠ˈkɛu̯ä" }, false }, { "nauta", { "ˈnau̯.ta", "ˈnäu̯t̪ä" }, { "ˈnau̯.ta", "ˈnäu̯t̪ä" } }, { "auctus", { "ˈau̯k.tus", "ˈäu̯kt̪ʊs̠" }, { "ˈau̯k.tus", "ˈäu̯kt̪us" } }, { "neu", { "neu̯", "nɛu̯" }, { "neu̯", "nɛu̯" }}, { "hau", { "hau̯", "häu̯" }, { "au̯", "äu̯" }}, "palatalization of c, g, sc", { "gerō", nil, { "ˈd͡ʒe.ro", "ˈd͡ʒɛːrɔ" } }, { "certus", nil, { "ˈt͡ʃer.tus", "ˈt͡ʃɛrt̪us" } }, { "faciō", nil, { "ˈfa.t͡ʃi.o", "ˈfäːt͡ʃiɔ" } }, { "caelus", nil, { "ˈt͡ʃe.lus", "ˈt͡ʃɛːlus" } }, { "scelus", nil, { "ˈʃe.lus", "ˈʃɛːlus" } }, { "suggillo", nil, { "sudˈd͡ʒil.lo", "sudˈd͡ʒilːɔ" } }, -- palatalization of sc (as ʃ) { "conscientia", nil, { "kon.ʃiˈen.t͡si.a", "kɔn̠ʲʃiˈɛnt̪͡s̪iä" } }, { "nescio", nil, { "ˈne.ʃi.o", "ˈnɛːʃiɔ" } }, { "masclus", nil, { "ˈmas.klus", "ˈmäsklus" } }, { "perscisco", nil, { "perˈʃis.ko", "pɛrˈʃiskɔ" } }, { "Volsci", nil, { "ˈvol.ʃi", "ˈvɔl̠ʲʃi" } }, { "abscindo", nil, { "apˈʃin.do", "äpˈʃin̪d̪ɔ" } }, --edge cases spelled with K that shouldn't display as palatalized { "berkelium", nil, { "berˈke.li.um", "bɛrˈkɛːlium" } }, { "alaskensis", nil, { "a.lasˈken.sis", "äläsˈkɛnsis" } }, "palatalization of t", -- Unlike Italian, Ecclesiastical Latin is not described as regularly doubling the t͡s sound resulting from affrication of t before i.		{ "nātiō", nil, { "ˈna.t͡si.o", "ˈnäːt̪͡s̪iɔ" } }, { "gluttiō", nil, { "ˈɡlut.ti.o", "ˈɡlut̪ːiɔ" } }, { "Christiānus", nil, { "kris.tiˈa.nus", "krist̪iˈäːnus" } }, { "satietas", nil, { "saˈt͡si.e.tas", "säˈt̪͡s̪iːɛt̪äs" } }, -- Some sources suggest that affrication occurs only in unstressed syllables (where /i/ could be reduced to /j/). --But I think that while this may describe the original environment of the sound change, it's not a condition for the conventional pronunciation. "narrow transcription of coronal plosives", { "apud", nil, { "ˈa.pud", "ˈäːpud̪" } }, { "dormiunt", nil, { "ˈdor.mi.unt", "ˈd̪ɔrmiun̪t̪" } }, "syllabification", { "obsolētus", { "ob.soˈleː.tus", "ɔps̠ɔˈɫ̪eːt̪ʊs̠" } }, { "ȳpsīlon", { "yːpˈsiː.lon", "yːpˈs̠iːɫ̪ɔn" } }, { "psychē", { "ˈpsy.kʰeː", "ˈps̠ʏkʰeː" } }, { "ū̆ncia", { "ˈuːn.ki.a", "ˈuːŋkiä" } }, { "mig;rō", { "ˈmi.ɡroː", "ˈmɪɡroː" } }, "hiatus", --{ "deeō", { "ˈde.e.oː", "ˈd̪eeoː" } }, --leaving this out as it's unclear what the intended behavior is. { "vīnea", { "ˈu̯iː.ne.a", "ˈu̯iːneä" }, { "ˈvi.ne.a", "ˈviːnɛä" } }, { "via", { "ˈu̯i.a", "ˈu̯iä" }, { "ˈvi.a", "ˈviːä" } }, { "Dryas", { "ˈdry.as", "ˈd̪ryäs̠" } }, { "duās", { "ˈdu.aːs", "ˈd̪uäːs̠" } },  -- Allen doesn't mention this. Some sources say u has a w-like glide in hiatus. { "svāvium", { "ˈsu̯aː.u̯i.um", "ˈs̠u̯äːu̯iʊ̃ˑ" }, { "ˈswa.vi.um", "ˈswäːvium" } }, { "quantus.vīs", { "kʷanˈtus.u̯iːs", "kʷän̪ˈt̪ʊs̠u̯iːs̠" }, { "kwanˈtus.vis", "kwän̪ˈt̪uzvis" } }, "voicing, place assimilation, and elision in Classical Latin heterosyllabic consonant clusters", { "adsum", { "ˈad.sum", "ˈäs̠ːʊ̃ˑ" } }, { "etsī", { "ˈet.siː", "ˈɛt̪s̠iː" } }, --no sources describe elision in the rare /t.s/ words { "adpetō", { "ˈad.pe.toː", "ˈäpːɛt̪oː" } }, { "quad.rāns", { "ˈkʷad.rans", "ˈkʷäd̪rä̃ːs̠" } }, --assimilation doesn't occur in morpheme-internal heterosyllabic /d.r/        { "adripiō", { "adˈri.pi.oː", "äd̪ˈrɪpioː" } },  --therefore, if we indicate assimilation in ad- prefixed words, it needs to special-coded { "postquam", { "ˈpost.kʷam", "ˈpɔs̠(t̪)kʷä̃ˑ" } }, --optional elision of coda /t/ in /st/ before a heterosyllabic following consonant { "stringō", { "ˈstrin.ɡoː", "ˈs̠t̪rɪŋɡoː" } }, --but /t/ in an onset cluster should never elide --Not implemented yet: "inter-word resyllabifications and assimilations for Classical Latin phrases", --{ "ad fontēs", { "at ˈfon.teːs", "at̪ˈfɔn̪t̪eːs̠" } }, --{ "ad astra", { "aˈd‿as.tra", "äˈd̪äs̠t̪rä" } }, --{ "eādem mūtāta resurgō", { "eˈaː.dem muːˈtaː.ta reˈsur.ɡoː", "eˈäːd̪ɛmmuːˈt̪äːt̪ärɛˈs̠ʊrɡoː" } }, --{ "ab ōvō ūsque ad māla", { "aˈb‿oː.ˈw‿uːs.kʷ‿ad ˈmaː.la", "äˈboːˈwuːs̠kʷäd̪ˈmäːɫ̪ä" } }, }	-- local options = { display = format_IPA } self:iterate(examples, function (self, word, Classical, Ecclesiastical)		if Classical then			self:equals( link(word) .. " (Classical)", format_IPA(to_IPA(word, false, false, false), to_IPA(word, true, false, false)), format_IPA(unpack(Classical)))		end		if Ecclesiastical then			self:equals( link(word) .. " (Ecclesiastical)", format_IPA(to_IPA(word, false, true, false), to_IPA(word, true, true, false)), format_IPA(unpack(Ecclesiastical)))		end	end) end

return tests