All tests passed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
a | a | a | |
akesi | a‧ke‧si | a‧ke‧si | |
ala | a‧la | a‧la | |
alasa | a‧la‧sa | a‧la‧sa | |
ale | a‧le | a‧le | |
ali | a‧li | a‧li | |
anpa | an‧pa | an‧pa | |
ante | an‧te | an‧te | |
anu | a‧nu | a‧nu | |
awen | a‧wen | a‧wen | |
e | e | e | |
en | en | en | |
epiku | e‧pi‧ku | e‧pi‧ku | |
esun | e‧sun | e‧sun | |
ijo | i‧jo | i‧jo | |
ike | i‧ke | i‧ke | |
ilo | i‧lo | i‧lo | |
insa | in‧sa | in‧sa | |
jaki | ja‧ki | ja‧ki | |
jan | jan | jan | |
jasima | ja‧si‧ma | ja‧si‧ma | |
jelo | je‧lo | je‧lo | |
jo | jo | jo | |
kala | ka‧la | ka‧la | |
kalama | ka‧la‧ma | ka‧la‧ma | |
kama | ka‧ma | ka‧ma | |
kasi | ka‧si | ka‧si | |
ken | ken | ken | |
kepeken | ke‧pe‧ken | ke‧pe‧ken | |
kijetesantakalu | ki‧je‧te‧san‧ta‧ka‧lu | ki‧je‧te‧san‧ta‧ka‧lu | |
kili | ki‧li | ki‧li | |
kin | kin | kin | |
kipisi | ki‧pi‧si | ki‧pi‧si | |
kiwen | ki‧wen | ki‧wen | |
ko | ko | ko | |
kokosila | ko‧ko‧si‧la | ko‧ko‧si‧la | |
kon | kon | kon | |
ku | ku | ku | |
kule | ku‧le | ku‧le | |
kulupu | ku‧lu‧pu | ku‧lu‧pu | |
kute | ku‧te | ku‧te | |
la | la | la | |
lanpan | lan‧pan | lan‧pan | |
lape | la‧pe | la‧pe | |
laso | la‧so | la‧so | |
lawa | la‧wa | la‧wa | |
leko | le‧ko | le‧ko | |
len | len | len | |
lete | le‧te | le‧te | |
li | li | li | |
lili | li‧li | li‧li | |
linja | lin‧ja | lin‧ja | |
lipu | li‧pu | li‧pu | |
loje | lo‧je | lo‧je | |
lon | lon | lon | |
luka | lu‧ka | lu‧ka | |
lukin | lu‧kin | lu‧kin | |
lupa | lu‧pa | lu‧pa | |
ma | ma | ma | |
mama | ma‧ma | ma‧ma | |
mani | ma‧ni | ma‧ni | |
meli | me‧li | me‧li | |
meso | me‧so | me‧so | |
mi | mi | mi | |
mije | mi‧je | mi‧je | |
misikeke | mi‧si‧ke‧ke | mi‧si‧ke‧ke | |
moku | mo‧ku | mo‧ku | |
moli | mo‧li | mo‧li | |
monsi | mon‧si | mon‧si | |
monsuta | mon‧su‧ta | mon‧su‧ta | |
mu | mu | mu | |
mun | mun | mun | |
musi | mu‧si | mu‧si | |
mute | mu‧te | mu‧te | |
n | n | n | |
namako | na‧ma‧ko | na‧ma‧ko | |
nanpa | nan‧pa | nan‧pa | |
nasa | na‧sa | na‧sa | |
nasin | na‧sin | na‧sin | |
nena | ne‧na | ne‧na | |
ni | ni | ni | |
nimi | ni‧mi | ni‧mi | |
noka | no‧ka | no‧ka | |
o | o | o | |
oko | o‧ko | o‧ko | |
olin | o‧lin | o‧lin | |
ona | o‧na | o‧na | |
open | o‧pen | o‧pen | |
pakala | pa‧ka‧la | pa‧ka‧la | |
pali | pa‧li | pa‧li | |
palisa | pa‧li‧sa | pa‧li‧sa | |
pan | pan | pan | |
pana | pa‧na | pa‧na | |
pi | pi | pi | |
pilin | pi‧lin | pi‧lin | |
pimeja | pi‧me‧ja | pi‧me‧ja | |
pini | pi‧ni | pi‧ni | |
pipi | pi‧pi | pi‧pi | |
poka | po‧ka | po‧ka | |
poki | po‧ki | po‧ki | |
pona | po‧na | po‧na | |
pu | pu | pu | |
sama | sa‧ma | sa‧ma | |
seli | se‧li | se‧li | |
selo | se‧lo | se‧lo | |
seme | se‧me | se‧me | |
sewi | se‧wi | se‧wi | |
sijelo | si‧je‧lo | si‧je‧lo | |
sike | si‧ke | si‧ke | |
sin | sin | sin | |
sina | si‧na | si‧na | |
sinpin | sin‧pin | sin‧pin | |
sitelen | si‧te‧len | si‧te‧len | |
soko | so‧ko | so‧ko | |
sona | so‧na | so‧na | |
soweli | so‧we‧li | so‧we‧li | |
suli | su‧li | su‧li | |
suno | su‧no | su‧no | |
supa | su‧pa | su‧pa | |
suwi | su‧wi | su‧wi | |
tan | tan | tan | |
taso | ta‧so | ta‧so | |
tawa | ta‧wa | ta‧wa | |
telo | te‧lo | te‧lo | |
tenpo | ten‧po | ten‧po | |
toki | to‧ki | to‧ki | |
tomo | to‧mo | to‧mo | |
tonsi | ton‧si | ton‧si | |
tu | tu | tu | |
unpa | un‧pa | un‧pa | |
uta | u‧ta | u‧ta | |
utala | u‧ta‧la | u‧ta‧la | |
walo | wa‧lo | wa‧lo | |
wan | wan | wan | |
waso | wa‧so | wa‧so | |
wawa | wa‧wa | wa‧wa | |
weka | we‧ka | we‧ka | |
wile | wi‧le | wi‧le |
local tests = require("Module:UnitTests")
local m_pron = require("Module:User:Kiril kovachev/tok-hyph")
local TokiPona = require("Module:languages").getByCode("tok")
local Latin = require("Module:scripts").getByCode("Latn")
local function link(term)
return require("Module:links").full_link{ term = term, lang = TokiPona, sc = Latin, tr = "-" }
end
local function identity(x)
return x
end
local display_syllabification = identity
function tests:check_output_syllabification(term, expected)
tests:equals(
link(term),
m_pron.syllabify(term),
mw.ustring.gsub(expected, "", "‧"),
{ display = display_syllabification }
)
end
function tests:test_syllabification()
-- Left side of elements: input to the function, which may include dots (.) for manual syllable division
-- Right side of elements: expected output, with syllable breaks indicated with a dot
local list = {
{"a", "a"},
{"akesi", "a.ke.si"},
{"ala", "a.la"},
{"alasa", "a.la.sa"},
{"ale", "a.le"},
{"ali", "a.li"},
{"anpa", "an.pa"},
{"ante", "an.te"},
{"anu", "a.nu"},
{"awen", "a.wen"},
{"e", "e"},
{"en", "en"},
{"epiku", "e.pi.ku"},
{"esun", "e.sun"},
{"ijo", "i.jo"},
{"ike", "i.ke"},
{"ilo", "i.lo"},
{"insa", "in.sa"},
{"jaki", "ja.ki"},
{"jan", "jan"},
{"jasima", "ja.si.ma"},
{"jelo", "je.lo"},
{"jo", "jo"},
{"kala", "ka.la"},
{"kalama", "ka.la.ma"},
{"kama", "ka.ma"},
{"kasi", "ka.si"},
{"ken", "ken"},
{"kepeken", "ke.pe.ken"},
{"kijetesantakalu", "ki.je.te.san.ta.ka.lu"},
{"kili", "ki.li"},
{"kin", "kin"},
{"kipisi", "ki.pi.si"},
{"kiwen", "ki.wen"},
{"ko", "ko"},
{"kokosila", "ko.ko.si.la"},
{"kon", "kon"},
{"ku", "ku"},
{"kule", "ku.le"},
{"kulupu", "ku.lu.pu"},
{"kute", "ku.te"},
{"la", "la"},
{"lanpan", "lan.pan"},
{"lape", "la.pe"},
{"laso", "la.so"},
{"lawa", "la.wa"},
{"leko", "le.ko"},
{"len", "len"},
{"lete", "le.te"},
{"li", "li"},
{"lili", "li.li"},
{"linja", "lin.ja"},
{"lipu", "li.pu"},
{"loje", "lo.je"},
{"lon", "lon"},
{"luka", "lu.ka"},
{"lukin", "lu.kin"},
{"lupa", "lu.pa"},
{"ma", "ma"},
{"mama", "ma.ma"},
{"mani", "ma.ni"},
{"meli", "me.li"},
{"meso", "me.so"},
{"mi", "mi"},
{"mije", "mi.je"},
{"misikeke", "mi.si.ke.ke"},
{"moku", "mo.ku"},
{"moli", "mo.li"},
{"monsi", "mon.si"},
{"monsuta", "mon.su.ta"},
{"mu", "mu"},
{"mun", "mun"},
{"musi", "mu.si"},
{"mute", "mu.te"},
{"n", "n"},
{"namako", "na.ma.ko"},
{"nanpa", "nan.pa"},
{"nasa", "na.sa"},
{"nasin", "na.sin"},
{"nena", "ne.na"},
{"ni", "ni"},
{"nimi", "ni.mi"},
{"noka", "no.ka"},
{"o", "o"},
{"oko", "o.ko"},
{"olin", "o.lin"},
{"ona", "o.na"},
{"open", "o.pen"},
{"pakala", "pa.ka.la"},
{"pali", "pa.li"},
{"palisa", "pa.li.sa"},
{"pan", "pan"},
{"pana", "pa.na"},
{"pi", "pi"},
{"pilin", "pi.lin"},
{"pimeja", "pi.me.ja"},
{"pini", "pi.ni"},
{"pipi", "pi.pi"},
{"poka", "po.ka"},
{"poki", "po.ki"},
{"pona", "po.na"},
{"pu", "pu"},
{"sama", "sa.ma"},
{"seli", "se.li"},
{"selo", "se.lo"},
{"seme", "se.me"},
{"sewi", "se.wi"},
{"sijelo", "si.je.lo"},
{"sike", "si.ke"},
{"sin", "sin"},
{"sina", "si.na"},
{"sinpin", "sin.pin"},
{"sitelen", "si.te.len"},
{"soko", "so.ko"},
{"sona", "so.na"},
{"soweli", "so.we.li"},
{"suli", "su.li"},
{"suno", "su.no"},
{"supa", "su.pa"},
{"suwi", "su.wi"},
{"tan", "tan"},
{"taso", "ta.so"},
{"tawa", "ta.wa"},
{"telo", "te.lo"},
{"tenpo", "ten.po"},
{"toki", "to.ki"},
{"tomo", "to.mo"},
{"tonsi", "ton.si"},
{"tu", "tu"},
{"unpa", "un.pa"},
{"uta", "u.ta"},
{"utala", "u.ta.la"},
{"walo", "wa.lo"},
{"wan", "wan"},
{"waso", "wa.so"},
{"wawa", "wa.wa"},
{"weka", "we.ka"},
{"wile", "wi.le"}
}
--[[
Additions take this form –
{ "word (with no accent required)", "expected syllabification" },
{ "", "" },
Make sure to include the comma, or the module will return an error.
]]
self:iterate(list, "check_output_syllabification")
end
return tests