Jump to content

Module:ny-IPA/testcases

From Wiktionary, the free dictionary

All tests passed. (refresh)

TextExpectedActual
test_pron:
Passedba/ɓa//ɓa/
Passedpa/pa//pa/
Passedpha/pʰa//pʰa/
Passedmba/ᵐba//ᵐba/
Passedmpha/ᵐpʰa//ᵐpʰa/
Passedma/ma//ma/
Passedŵa/w⁽ᵝ⁾a//w⁽ᵝ⁾a/
Passedbwe/ɓʷe//ɓʷe/
Passedpwa/pʷa//pʷa/
Passedphwa/pʷʰa//pʷʰa/
Passedmbwo/ᵐbʷo//ᵐbʷo/
Passedmphwu/ᵐpʷʰu//ᵐpʷʰu/
Passedmwo/mʷo//mʷo/
Passedwa/wa//wa/
Passedbza/bzʲa//bzʲa/
Passedpya/pʲa//pʲa/
Passedpsa/psʲa//psʲa/
Passedmbza/ᵐbzʲa//ᵐbzʲa/
Passedmpsa/ᵐpsʲa//ᵐpsʲa/
Passedmya/mʲa//mʲa/
Passedda/ɗa//ɗa/
Passedta/ta//ta/
Passedtha/tʰa//tʰa/
Passednda/ⁿda//ⁿda/
Passedntha/ⁿtʰa//ⁿtʰa/
Passedna/na//na/
Passedla/ɽa//ɽa/
Passedri/ɽi//ɽi/
Passeddwa/ɗʷa//ɗʷa/
Passedtwa/tʷa//tʷa/
Passedthwa/tʷʰa//tʷʰa/
Passedndwa/ⁿdʷa//ⁿdʷa/
Passednthwa/ⁿtʷʰa//ⁿtʷʰa/
Passedlwa/ɽʷa//ɽʷa/
Passedrwa/ɽʷa//ɽʷa/
Passeddya/ɗʲa//ɗʲa/
Passedtya/tʲa//tʲa/
Passedthya/tʲʰa//tʲʰa/
Passedndya/ⁿdʲa//ⁿdʲa/
Passednthya/ⁿtʲʰa//ⁿtʲʰa/
Passedga/ɡa//ɡa/
Passedka/ka//ka/
Passedkha/kʰa//kʰa/
Passednga/ᵑɡa//ᵑɡa/
Passednkha/ᵑkʰa//ᵑkʰa/
Passedng'a/ŋa//ŋa/
Passedha/ha//ha/
Passedgwa/ɡʷa//ɡʷa/
Passedkwa/kʷa//kʷa/
Passedkhwa/kʷʰa//kʷʰa/
Passedngwa/ᵑɡʷa//ᵑɡʷa/
Passednkhwa/ᵑkʷʰa//ᵑkʷʰa/
Passedng'wa/ŋʷa//ŋʷa/
Passedja/d͡ʒa//d͡ʒa/
Passedńcha/ˈń.t͡ʃa//ˈń.t͡ʃa/
Passedtcha/t͡ʃʰa//t͡ʃʰa/
Passednja/ⁿd͡ʒa//ⁿd͡ʒa/
Passedntcha/ⁿt͡ʃʰa//ⁿt͡ʃʰa/
Passednya/ɲa//ɲa/
Passedya/ja//ja/
Passedva/va//va/
Passedfa/fa//fa/
Passedmva/ᶬva//ᶬva/
Passedmfa/ᶬfa//ᶬfa/
Passedvwa/vʷa//vʷa/
Passedfwa/fʷa//fʷa/
Passedvya/vʲa//vʲa/
Passedfya/fʲa//fʲa/
Passedza/za//za/
Passedsa/sa//sa/
Passednza/ⁿza//ⁿza/
Passednsa/ⁿsa//ⁿsa/
Passedzwa/zʷa//zʷa/
Passedswa/sʷa//sʷa/
Passednzwa/ⁿzʷa//ⁿzʷa/
Passednswa/ⁿsʷa//ⁿsʷa/
Passedzya/ʒa//ʒa/
Passedsha/ʃa//ʃa/
Passeddza/d͡za//d͡za/
Passedtsa/t͡sa//t͡sa/
Passedndza/ⁿd͡za//ⁿd͡za/
Passeddzwe/d͡zʷe//d͡zʷe/
Passedtswa/t͡sʷa//t͡sʷa/
Passedáwu/ˈá.(w)u//ˈá.(w)u/
Passedéwu/ˈé.(w)u//ˈé.(w)u/
Passedíwu/ˈí.(w)u//ˈí.(w)u/
Passedówa/ˈó.(w)a//ˈó.(w)a/
Passedúwa/ˈú.(w)a//ˈú.(w)a/
Passedbamphwenthing'wódzwu/ɓa.ᵐpʷʰe.ⁿtʰiˈŋʷó.d͡zʷu//ɓa.ᵐpʷʰe.ⁿtʰiˈŋʷó.d͡zʷu/
Passedzása/ˈzá.sa//ˈzá.sa/
Passedzwam'báfwa/zʷa.mˈɓá.fʷa//zʷa.mˈɓá.fʷa/
Passedb'ála/ˈbá.ɽa//ˈbá.ɽa/
Passedm'phunzitsi/m.pʰuˈⁿzi.t͡si//m.pʰuˈⁿzi.t͡si/
Passedanáḿpatsa/a.ná.ḿˈpa.t͡sa//a.ná.ḿˈpa.t͡sa/
Passedkamwaná/kaˈmʷa.ná//kaˈmʷa.ná/
Passedmwána/ˈmʷá.na//ˈmʷá.na/
Passedmunthu/ˈmu.ⁿtʰu//ˈmu.ⁿtʰu/
Passedkamwana/kaˈmʷa.na//kaˈmʷa.na/
PassedM'chewa/mˈt͡ʃe.wa//mˈt͡ʃe.wa/
Passedd'úla/ˈdú.ɽa//ˈdú.ɽa/
Passeduta/ˈu.ta//ˈu.ta/
Passedzíkomo kwámbíri/zíˈko.mo kʷáˈᵐbí.ɽi//zíˈko.mo kʷáˈᵐbí.ɽi/
Passedzíkomo/zíˈko.mo//zíˈko.mo/
Passed-onse/ˈo.ⁿse//ˈo.ⁿse/
Passedng'ombe/ˈŋo.ᵐbe//ˈŋo.ᵐbe/
PassedM'maláŵi/m.maˈɽá.w⁽ᵝ⁾i//m.maˈɽá.w⁽ᵝ⁾i/
Passedmawú/ˈma.(w)ú//ˈma.(w)ú/
Passedmáyí wáḿkúlu/ˈmá.jí wá.ḿˈkú.ɽu//ˈmá.jí wá.ḿˈkú.ɽu/

local tests = require('Module:UnitTests')
local m_ny_pron = require('Module:ny-IPA')
local m_links = require('Module:links')

local function tag_IPA(IPA)
	return '<span class="IPA">' .. IPA .. '</span>'
end

function tests:check_pron(text, IPA)
	self:equals(
		text,
		m_ny_pron.IPA(text),
		IPA,
		{ display = tag_IPA }
	)
end

function tests:test_pron()

	local examples = {
		{ "ba", "/ɓa/" },
		{ "pa", "/pa/" },
		{ "pha", "/pʰa/" },
		{ "mba", "/ᵐba/" },
		{ "mpha", "/ᵐpʰa/" },
		{ "ma", "/ma/" },
		{ "ŵa", "/w⁽ᵝ⁾a/" },
	
		{ "bwe", "/ɓʷe/" },
		{ "pwa", "/pʷa/" },
		{ "phwa", "/pʷʰa/" },
		{ "mbwo", "/ᵐbʷo/" },
		{ "mphwu", "/ᵐpʷʰu/" },
		{ "mwo", "/mʷo/" },
		{ "wa", "/wa/" },
	
		{ "bza", "/bzʲa/" },
		{ "pya", "/pʲa/" },
		{ "psa", "/psʲa/" },
		{ "mbza", "/ᵐbzʲa/" },
		{ "mpsa", "/ᵐpsʲa/" },
		{ "mya", "/mʲa/" },
	
		{ "da", "/ɗa/" },
		{ "ta", "/ta/" },
		{ "tha", "/tʰa/" },
		{ "nda", "/ⁿda/" },
		{ "ntha", "/ⁿtʰa/" },
		{ "na", "/na/" },
		{ "la", "/ɽa/" },
		{ "ri", "/ɽi/" },
	
		{ "dwa", "/ɗʷa/" },
		{ "twa", "/tʷa/" },
		{ "thwa", "/tʷʰa/" },
		{ "ndwa", "/ⁿdʷa/" },
		{ "nthwa", "/ⁿtʷʰa/" },
		{ "lwa", "/ɽʷa/" },
		{ "rwa", "/ɽʷa/" },
	
		{ "dya", "/ɗʲa/" },
		{ "tya", "/tʲa/" },
		{ "thya", "/tʲʰa/" },
		{ "ndya", "/ⁿdʲa/" },
		{ "nthya", "/ⁿtʲʰa/" },
	
		{ "ga", "/ɡa/" },
		{ "ka", "/ka/" },
		{ "kha", "/kʰa/" },
		{ "nga", "/ᵑɡa/" },
		{ "nkha", "/ᵑkʰa/" },
		{ "ng'a", "/ŋa/" },
		{ "ha", "/ha/" },
	
		{ "gwa", "/ɡʷa/" },
		{ "kwa", "/kʷa/" },
		{ "khwa", "/kʷʰa/" },
		{ "ngwa", "/ᵑɡʷa/" },
		{ "nkhwa", "/ᵑkʷʰa/" },
		{ "ng'wa", "/ŋʷa/" },
	
		{ "ja", "/d͡ʒa/" },
		{ "ńcha", "/ˈń.t͡ʃa/" },
		{ "tcha", "/t͡ʃʰa/" },
		{ "nja", "/ⁿd͡ʒa/" },
		{ "ntcha", "/ⁿt͡ʃʰa/" },
		{ "nya", "/ɲa/" },
		{ "ya", "/ja/" },
	
		{ "va", "/va/" },
		{ "fa", "/fa/" },
		{ "mva", "/ᶬva/" },
		{ "mfa", "/ᶬfa/" },
		{ "vwa", "/vʷa/" },
		{ "fwa", "/fʷa/" },
		{ "vya", "/vʲa/" },
		{ "fya", "/fʲa/" },
	
		{ "za", "/za/" },
		{ "sa", "/sa/" },
		{ "nza", "/ⁿza/" },
		{ "nsa", "/ⁿsa/" },
		{ "zwa", "/zʷa/" },
		{ "swa", "/sʷa/" },
		{ "nzwa", "/ⁿzʷa/" },
		{ "nswa", "/ⁿsʷa/" },
		{ "zya", "/ʒa/" },
		{ "sha", "/ʃa/" },
	
		{ "dza", "/d͡za/" },
		{ "tsa", "/t͡sa/" },
		{ "ndza", "/ⁿd͡za/" },
		{ "dzwe", "/d͡zʷe/" },
		{ "tswa", "/t͡sʷa/" },
	
		{ "áwu", "/ˈá.(w)u/" },
		{ "éwu", "/ˈé.(w)u/" },
		{ "íwu", "/ˈí.(w)u/" },
		{ "ówa", "/ˈó.(w)a/" },
		{ "úwa", "/ˈú.(w)a/" },
	
		{ "bamphwenthing'wódzwu", "/ɓa.ᵐpʷʰe.ⁿtʰiˈŋʷó.d͡zʷu/" },
		{ "zása", "/ˈzá.sa/" },
		{ "zwam'báfwa", "/zʷa.mˈɓá.fʷa/" },
		{ "b'ála", "/ˈbá.ɽa/" },
		{ "m'phunzitsi", "/m.pʰuˈⁿzi.t͡si/" },
		{ "anáḿpatsa", "/a.ná.ḿˈpa.t͡sa/" },
		{ "kamwaná", "/kaˈmʷa.ná/" },
		{ "mwána", "/ˈmʷá.na/" },
		{ "munthu", "/ˈmu.ⁿtʰu/" },
		{ "kamwana", "/kaˈmʷa.na/" },
		{ "M'chewa", "/mˈt͡ʃe.wa/" },
		{ "d'úla", "/ˈdú.ɽa/" }, 
		{ "uta", "/ˈu.ta/" },
		{ "zíkomo kwámbíri", "/zíˈko.mo kʷáˈᵐbí.ɽi/" },
		{ "zíkomo", "/zíˈko.mo/" },
		{ "-onse", "/ˈo.ⁿse/" },
		{ "ng'ombe", "/ˈŋo.ᵐbe/" },
		{ "M'maláŵi", "/m.maˈɽá.w⁽ᵝ⁾i/" },  
		{ "mawú", "/ˈma.(w)ú/" }, 
		{ "máyí wáḿkúlu", "/ˈmá.jí wá.ḿˈkú.ɽu/" },
	}
	
	self:iterate(examples, "check_pron")

end

return tests