Module:User:Erutuon/en-pronunciation/testcases
Jump to navigation
Jump to search
- The following documentation is located at Module:User:Erutuon/en-pronunciation/testcases/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • user page • user talk page • userspace
All tests passed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
![]() | ˈlɔɪ.ə (RP) | ˈlɔə | ˈlɔə |
![]() | ˈloj.ə (Lindsey) | ˈloː | ˈloː |
![]() | ˈləʊə (RP) | ˈləə | ˈləə |
![]() | ˈləwə (Lindsey) | ˈləː | ˈləː |
![]() | laɪəˈbɪlɪti (RP) | laəˈbɪlɪti | laəˈbɪlɪti |
![]() | lɑjəˈbɪlɪtɪj (Lindsey) | lɑːˈbɪlɪtɪj | lɑːˈbɪlɪtɪj |
![]() | ˈpeɪə (RP) | ˈpeə | ˈpeə |
![]() | ˈpɛjə (Lindsey) | ˈpɛː | ˈpɛː |
![]() | ˈfɹiːə (RP) | ˈfɹɪə | ˈfɹɪə |
![]() | ˈfɹɪjə (Lindsey) | ˈfɹɪː | ˈfɹɪː |
![]() | sɪˈkjuːə (RP) | sɪˈkjʊə | sɪˈkjʊə |
![]() | sɪˈkjʉwə (Lindsey) | sɪˈkjɵː | sɪˈkjɵː |
![]() | ˈflɑʊə (RP) | ˈflɑə | ˈflɑə |
![]() | ˈflawə (Lindsey) | ˈflaː | ˈflaː |
Text | Expected | Actual | |
---|---|---|---|
![]() | ˈlɔɪ.ə (RP → Lindsey) | ˈloj.ə | ˈloj.ə |
![]() | ˈmeə (RP → Lindsey) | ˈmɛː | ˈmɛː |
![]() | æmbɪˈgjuːɪti (RP → Lindsey) | ambɪˈgjʉwɪtɪj | ambɪˈgjʉwɪtɪj |
![]() | ˈləʊə (RP → Lindsey) | ˈləwə | ˈləwə |
local tests = require "Module:UnitTests"
local m_pron = require "Module:User:Erutuon/en-pronunciation"
local convert = m_pron.convert
local smooth = m_pron.smooth
local function tag(text)
return '<span class="IPA">' .. text .. '</span>'
end
local options = { display = tag }
function tests:check_system_conversion(example, from, to, expected)
self:equals(tag(example) .. " (" .. from .. " → " .. to .. ")", convert(example, from, to), expected, options)
end
function tests:test_system_conversion()
local examples = {
{ "ˈlɔɪ.ə", "RP", "Lindsey", "ˈloj.ə" },
{ "ˈmeə", "RP", "Lindsey", "ˈmɛː" },
{ "æmbɪˈgjuːɪti", "RP", "Lindsey", "ambɪˈgjʉwɪtɪj" },
{ "ˈləʊə", "RP", "Lindsey", "ˈləwə" },
}
self:iterate(examples, "check_system_conversion")
end
function tests:check_smoothing(example, system, expected)
self:equals(
tag(example) .. " (" .. system .. ")",
smooth(example, system),
expected,
options)
end
function tests:test_smoothing()
local examples = {
{ "ˈlɔɪ.ə", "RP", "ˈlɔə" }, -- a pronunciation of lawyer
{ "ˈloj.ə", "Lindsey", "ˈloː" },
{ "ˈləʊə", "RP", "ˈləə" }, -- lower
{ "ˈləwə", "Lindsey", "ˈləː" },
{ "laɪəˈbɪlɪti", "RP", "laəˈbɪlɪti" }, -- liability
{ "lɑjəˈbɪlɪtɪj", "Lindsey", "lɑːˈbɪlɪtɪj" },
{ "ˈpeɪə", "RP", "ˈpeə" }, -- payer: smoothing unlikely?
{ "ˈpɛjə", "Lindsey", "ˈpɛː" },
{ "ˈfɹiːə", "RP", "ˈfɹɪə" }, -- freer: smoothing unlikely?
{ "ˈfɹɪjə", "Lindsey", "ˈfɹɪː" },
{ "sɪˈkjuːə", "RP", "sɪˈkjʊə" }, -- secure; this pronunciation probably not used in RP; better example?
{ "sɪˈkjʉwə", "Lindsey", "sɪˈkjɵː" },
{ "ˈflɑʊə", "RP", "ˈflɑə" }, -- flower
{ "ˈflawə", "Lindsey", "ˈflaː" },
--[[
{ "", "", "" },
--]]
}
self:iterate(examples, "check_smoothing")
end
return tests