Module:ca-IPA/testcases

local tests = require("Module:UnitTests") local driver = require("Module:ca-IPA/testcases/driver")

--[=[ Each line of the example text is either a high-level header beginning with ###, a subheader beginning with ##, a comment beginning with #, a blank line or an example. Examples consist of three tab-separated fields, followed by an optional comment to be shown along with the example (delimited by a # preceded by whitespace). The first field is the actual spelling of the term in question. The second field is the respelling. The third field is the expected phonemic IPA pronunciation.

See Module:ca-IPA/testcases/driver for more detailed information on the format of examples, along with information on how to create a new subset of testcases. ]=]

local examples = [==[
 * 1) Specific letter combinations

abisme	+	əˈβiz.mə admetre	ê	ədˈmɛ.tɾə curtmetratge	[úr,àt]	ˌkurd.məˈtɾa.dʒə sordmut	[só,út]	ˌsordˈmut sotmetre	ê	sudˈmɛ.tɾə diferentment	+	di.fəˌɾenˈmen ammonit	+	əm.muˈnit apotegma	è	ə.puˈtɛɡ.mə fragment	+	fɾəɡˈmen augmentar	+	əwɡ.mənˈta llargmetratge	+	ˌʎarɡ.məˈtɾa.dʒə Caixmir	[rr]	kəʒˈmir algoritme	+	əl.ɣuˈɾid.mə setmana	[tm:mm]	səmˈma.nə setmesó	[sè]	ˌsed.məˈzo tmesi	è	ˈdmɛ.zi wàttmetre	[w:v]	ˈbad.mə.tɾə istme	+	ˈiz.mə dracma	+	ˈdɾaɡ.mə francmaçó	+	ˌfɾã.məˈso turcman	+	turɡˈman Turkmenistan	+	turɡ.mə.nisˈtan khmer	[érr]	ˈkmer submarí	+	sum.məɾˈi
 * 1) Voicing assimilation before m

hafni	+	ˈav.ni ovni	ò	ˈɔv.ni abnegació	+	əm.nə.ɣə.siˈo subnormal	+	sum.nurˈmal estibnita	+	əs.timˈni.tə acne	+	ˈaŋ.nə aràcnid	+	əˈɾaŋ.nit electrotècnia	[lè]	əˌlɛk.tɾuˈtɛŋ.ni.ə pícnic	+	ˈpiŋ.nik Agnès	+	əŋˈnɛs cigne	+	ˈsiŋ.nə apnea	é	əbˈne.ə dispnea	é	dizmˈne.ə hipnosi	ò	imˈnɔ.zi pneumàtic	+	nəwˈma.tik
 * 1) Voicing assimilation before n

afluent	+	ə.fluˈen deslleial	+	dəz.ʎəˈjal becllarg	+	beɡˈʎaɾk Israel	è	iz.rəˈɛl sahrauí	+	sə.rəˈwi
 * 1) Voicing assimilation before l, r

afganès	+	əv.ɣəˈnɛs dubtar	+	dupˈta
 * 1) Voicing assimilation before stops

postgrau	[òs,àu]	ˌpɔzˈɡɾaw postguerra	[òs,èr]	ˌpɔzˈɡɛ.rə postludi	[òs,lú]	ˌpɔzˈlu.ði posttraumàtic	[òs]	ˌpɔs.tɾəwˈma.tik presumpció	+	pɾə.zum.siˈo
 * 1) Elision of consonants in post- (and subsequent voicing assimilation)

preeminent	+	pɾə.ə.miˈnen meteor	[ôrr]	mə.teˈɔɾ meteorit	+	mə.te.uˈɾit aerologia	+	ə.e.ɾu.luˈʒi.ə aeròmetre	+	ə.eˈɾɔ.mə.tɾə realista	+	re.əˈlis.tə neòfit	+	neˈɔ.fit neolític	+	ne.uˈli.tik
 * 1) Reduction of a/e next to another vowel

setmana	[tm:mm]	səmˈma.nə setmana	[tm:m]	seˈma.na	val aritmètic	+	ə.ɾidˈmɛ.tik aritmètic	+	a.ɾidˈmɛ.tik	val tmesi	è	ˈdmɛ.zi tmesi	è	ˈmɛ.zi	val ametlla	[m:mm,ê]	əmˈmɛʎ.ʎə ametlla	[ê]	aˈmeʎ.ʎa	val bitllet	ê	biʎˈʎɛt bitllet	ê	biˈʎet	val atlàntic	+	əlˈlan.tik atlàntic	+	adˈlan.tik	val decatló	+	də.kəlˈlo decatló	+	de.kadˈlo	val motle	ò	ˈmɔl.le	val vietnamita	+	bi.ən.nəˈmi.tə vietnamita	+	vi.ed.naˈmi.ta	val cotna	ó	ˈkon.nə cotna	ó	ˈkon.na	val ]==]
 * 1) Sequences of t + m/n/l/ll

function tests:check_ipa(spelling, respelling, expected, comment) return driver.check_ipa(self, spelling, respelling, expected, comment) end

function tests:test self:iterate(driver.parse(examples), "check_ipa") end

return tests