Module:is-pronunciation/testcases
Jump to navigation
Jump to search
- The following documentation is located at Module:is-pronunciation/testcases/documentation. [edit] Categories were auto-generated by Module:module categorization. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • sandbox
All tests passed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
þorn | ˈθɔrtn̥ | ˈθɔrtn̥ | |
himinn | ˈhɪːmɪnː | ˈhɪːmɪnː | |
brúnn | ˈprutn̥ | ˈprutn̥ | |
steinn | ˈstɛi̯tn̥ | ˈstɛi̯tn̥ | |
geimsteinn (respelled geim-steinn) | ˈcɛi̯mstɛi̯tn̥ | ˈcɛi̯mstɛi̯tn̥ | |
karl | ˈkʰartl̥ | ˈkʰartl̥ | |
rusl | ˈrʏstl̥ | ˈrʏstl̥ | |
bysna | ˈpɪstn̥a | ˈpɪstn̥a | |
ráps (respelled ráp.s) | ˈrau̯ːps | ˈrau̯ːps | |
taka | ˈtʰaːka | ˈtʰaːka | |
þökk | ˈθœhk | ˈθœhk | |
vopn | ˈvɔhpn̥ | ˈvɔhpn̥ | |
brotna | ˈprɔhtn̥a | ˈprɔhtn̥a | |
sakna | ˈsahkn̥a | ˈsahkn̥a | |
kembt | ˈcʰɛm̥t | ˈcʰɛm̥t | |
þið | ˈθɪːð | ˈθɪːð | |
guð | ˈkvʏːð | ˈkvʏːð | |
byggja | ˈpɪcːa | ˈpɪcːa | |
syngja | ˈsinca | ˈsinca | |
munkur | ˈmuŋkʏr | ˈmuŋkʏr | |
öngull | ˈœy̯ŋkʏtl̥ | ˈœy̯ŋkʏtl̥ | |
drengur | ˈtrɛi̯ŋkʏr | ˈtrɛi̯ŋkʏr | |
svangur | ˈsvau̯ŋkʏr | ˈsvau̯ŋkʏr | |
England | ˈɛi̯ŋlant | ˈɛi̯ŋlant | |
segja | ˈsɛi̯ːja | ˈsɛi̯ːja | |
fluga | ˈflʏːɣa | ˈflʏːɣa | |
fljúga | ˈfljuːa | ˈfljuːa | |
bógur | ˈpou̯ːʏr | ˈpou̯ːʏr | |
lágur | ˈlau̯ːʏr | ˈlau̯ːʏr | |
prófa | ˈpʰrou̯ːa | ˈpʰrou̯ːa | |
dags | ˈtaxs | ˈtaxs | |
dragt | ˈtraxt | ˈtraxt | |
guðspjall (respelled guð-spjall) | ˈkvʏðspjatl̥ | ˈkvʏðspjatl̥ | |
september | ˈsɛftɛmpɛr | ˈsɛftɛmpɛr | |
október | ˈɔxtou̯pɛr | ˈɔxtou̯pɛr | |
gjalda | ˈcalta | ˈcalta | |
geta | ˈcɛːta | ˈcɛːta | |
kjósa | ˈcʰou̯ːsa | ˈcʰou̯ːsa | |
keyra | ˈcʰɛi̯ːra | ˈcʰɛi̯ːra | |
kirkja | ˈcʰɪrca | ˈcʰɪrca | |
hlýr | ˈl̥iːr | ˈl̥iːr | |
hratt | ˈr̥aht | ˈr̥aht | |
spara | ˈspaːra | ˈspaːra | |
þykja | ˈθɪːca | ˈθɪːca | |
lofa | ˈlɔːva | ˈlɔːva | |
rós | ˈrou̯ːs | ˈrou̯ːs | |
vaxa | ˈvaxsa | ˈvaxsa | |
mylla, special=true | ˈmɪlːa | ˈmɪlːa | |
nudda | ˈnʏtːa | ˈnʏtːa | |
kaþólikki | ˈkʰaːθou̯lɪhcɪ | ˈkʰaːθou̯lɪhcɪ |
local tests = require("Module:UnitTests")
local m_IPA = require("Module:is-pronunciation")
local gsub = mw.ustring.gsub
local format = mw.ustring.format
local function tag_IPA(IPA)
return '<span class="IPA">' .. IPA .. '</span>'
end
local function generate_link(term)
return gsub(term, "[%-%.]", "")
end
function tests:check_output(term, expected, respell, accent, special)
local generated_link = generate_link(term)
local respelled_term = respell or term
return tests:equals(
m_IPA.tag_text(m_IPA.link(generated_link)) ..
(respelled_term ~= generated_link and format(" (respelled %s)", m_IPA.tag_text(respelled_term)) or "") ..
(special and ", special=true" or ""),
m_IPA.toIPA(term, accent, special),
expected,
{ display = tag_IPA }
)
end
function tests:test_pron()
local list = {
{"þorn", "ˈθɔrtn̥" },
{"himinn", "ˈhɪːmɪnː" },
{"brúnn", "ˈprutn̥" },
{"steinn", "ˈstɛi̯tn̥" },
{"geim-steinn", "ˈcɛi̯mstɛi̯tn̥" },
{"karl", "ˈkʰartl̥" },
{"rusl", "ˈrʏstl̥" },
{"bysna", "ˈpɪstn̥a" },
{"ráp.s", "ˈrau̯ːps" },
{"taka", "ˈtʰaːka" },
{"þökk", "ˈθœhk" },
{"vopn", "ˈvɔhpn̥" },
{"brotna", "ˈprɔhtn̥a" },
{"sakna", "ˈsahkn̥a" },
{"kembt", "ˈcʰɛm̥t" },
{"þið", "ˈθɪːð" },
{"guð", "ˈkvʏːð" },
{"byggja", "ˈpɪcːa" },
{"syngja", "ˈsinca" },
{"munkur", "ˈmuŋkʏr" },
{"öngull", "ˈœy̯ŋkʏtl̥"},
{"drengur", "ˈtrɛi̯ŋkʏr" },
{"svangur", "ˈsvau̯ŋkʏr" },
{"England", "ˈɛi̯ŋlant" },
{"segja", "ˈsɛi̯ːja" },
{"fluga", "ˈflʏːɣa" },
{"fljúga", "ˈfljuːa" },
{"bógur", "ˈpou̯ːʏr" },
{"lágur", "ˈlau̯ːʏr" },
{"prófa", "ˈpʰrou̯ːa" },
{"dags", "ˈtaxs" },
{"dragt", "ˈtraxt" },
{"guð-spjall", "ˈkvʏðspjatl̥" },
{"september", "ˈsɛftɛmpɛr" },
{"október", "ˈɔxtou̯pɛr" },
{"gjalda", "ˈcalta" },
{"geta", "ˈcɛːta" },
{"kjósa", "ˈcʰou̯ːsa" },
{"keyra", "ˈcʰɛi̯ːra" },
{"kirkja", "ˈcʰɪrca" },
{"hlýr", "ˈl̥iːr" },
{"hratt", "ˈr̥aht" },
{"spara", "ˈspaːra" },
{"þykja", "ˈθɪːca" },
{"lofa", "ˈlɔːva" },
{"rós", "ˈrou̯ːs" },
{"vaxa", "ˈvaxsa" },
{"mylla", "ˈmɪlːa", nil, nil, true },
{"nudda", "ˈnʏtːa" },
{"kaþólikki", "ˈkʰaːθou̯lɪhcɪ" }
}
self:iterate(list, "check_output")
end
--[[
Additions take this form –
{ "entry name", "IPA" },
{ "", "" },
or, if you are generating IPA from a respelling of the term –
{ "respelling", "IPA", "entry name" }
{ "", "", "" },
Make sure to include the comma, or the module will return an error.
]]--
return tests