Module:bcl-pron/testcases

local tests = require("Module:UnitTests") local m_bcl_pron = require("Module:bcl-pron")

local function tag_IPA(IPA) return " " .. IPA .. " " end

function tests:check_phonetic_ipa(text, expected, respelling) self:equals(		"" .. text .. "",		m_bcl_pron.IPA(respelling, true),		expected,		{ display = tag_IPA }	) end

function tests:test_phonetic_pron local examples = { { "aldaw", "ʔal̪ˈd̪aʊ̯", "aldáw" }, { "anyil", "ʔaˈɲil̪", "anyíl" }, { "aso", "ˈʔa.so", "aso" }, { "baak", "ˈbaʔ.ak", "bâak"}, { "babaye","baˈba.je", "babaye" }, { "baga","ˈba.ɡaʔ", "bagà" }, { "baga","baˈɡaʔ", "bagâ" }, { "baka","ˈba.ka", "baka" }, { "bakla","bakˈl̪aʔ", "baklâ" }, { "banyo","ˈba.ɲo", "banyo" }, { "bareta","baˈɾe.taʔ", "baretà" }, { "basog", "baˈsoɡ", "basóg" }, { "bitaog", "biˈtaʔ.oɡ", "bitâog"}, { "Camarines Sur","ka.maˈɾi.n̪es suɾ","Camarines Sur"}, { "Carlos","ˈkaɾ.l̪os","Carlos"}, { "daan","ˈd̪aʔ.an̪", "dâan" }, { "datong","d̪aˈtoŋ", "datóng" }, { "dila", "ˈd̪i.l̪aʔ", "dilà" }, { "diyaryo","ˈd͡ʒaɾ.jo", "diyaryo" }, { "dominggo", "d̪oˈmiŋ.ɡo", "dominggo"}, { "duwa", "ˈd̪wa", "duwá"}, { "hadok","haˈd̪ok", "hadók" }, { "hagok","ˈhaʔ.ɡok", "hàgok" }, { "hiwa","ˈhi.waʔ", "hiwà" }, { "hiwaon","hiˈwaʔ.on̪", "hiwâon" }, { "ina","ʔiˈn̪a", "iná" }, { "kabaong", "kaˈbaʔ.oŋ", "kabâong"}, { "katre", "ˈkat.ɾe", "katre"}, { "lagadi","l̪aˈɡa.d̪iʔ","lagadì"}, { "lapida","ˈl̪a.pi.d̪a","lápida"}, { "laya","ˈl̪aʔ.ja","lâya"}, { "Legazpi","l̪eˈɡas.pi","Legazpi"}, { "ligwan","l̪iɡˈwan̪","ligwán"}, { "linog","ˈl̪i.n̪oɡ","linog"}, { "luob","l̪uʔˈob","lù.ób"}, { "luto","ˈl̪u.toʔ","lutò"}, { "Niño","ˈn̪i.ɲo","Niño"}, { "nganga","ˈŋa.ŋa","nganga"}, { "pakla","pakˈl̪a", "paklá" }, { "parakol","pa.ɾaˈkol̪", "parakól" }, { "pinto","pin̪ˈtoʔ", "pintô" }, { "pulo","puˈl̪oʔ", "pulô" }, }

self:iterate(examples, "check_phonetic_ipa") end

return tests