Module:fi-pronunciation/testcases
- The following documentation is located at Module:fi-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 | |
---|---|---|---|
rhyme detection | |||
![]() | kala | ɑlɑ | ɑlɑ |
![]() | lehto | ehto | ehto |
![]() | ehto | ehto | ehto |
![]() | yö | yø | yø |
![]() | omenanamme | ɑmːe | ɑmːe |
![]() | liu'utus | iu.utus | iu.utus |
local tests = require "Module:UnitTests"
local rhyme = require "Module:fi-pronunciation".generate_rhyme
local function link_fi(term)
return '<span class="Latn" lang="fi">[[' .. term .. "#Finnish|" .. term .. ']]</span>'
end
local function tag_IPA(transcription)
return '<span class="IPA">' .. transcription .. '</span>'
end
function tests:test_phonetic()
local examples = {
"rhyme detection",
{ "kala", "ɑlɑ" },
{ "lehto", "ehto" },
{ "ehto", "ehto" },
{ "yö", "yø" },
{ "omenanamme", "ɑmːe" },
{ "liu'utus", "iu.utus" }, -- iuʔutus
}
local options = { display = tag_IPA }
self:iterate(examples,
function (self, term, expected, respelling)
self:equals(
link_fi(term)
.. (respelling and " (<kbd>" .. respelling .. "</kbd>)" or ""),
rhyme(respelling or term, true),
expected, options)
end)
end
return tests