Module:syllables/testcases

Hello, you have come here looking for the meaning of the word Module:syllables/testcases. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:syllables/testcases, but we will also tell you about its etymology, its characteristics and you will know how to say Module:syllables/testcases in singular and plural. Everything you need to know about the word Module:syllables/testcases you have here. The definition of the word Module:syllables/testcases will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:syllables/testcases, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

All tests passed. (refresh)

TextExpectedActual
test:
Passed/noʊ ˈhaɪweɪ ˈkaʊboɪz/55
Passedðɛɚ22
Passedðɛɹ11
Passed/avə(ʊ)ˈkeɪʃən/44
Passed/-eɪʃəs/(nil)(nil)
Passed/ɛː.e.lí.o͜i.o/55
Passed/vl̩k/11
Passed/ˈɑːmiɑi̯smɑjoi̯tus/66
Passed/ˈɛi̯ərə(n)/33

local tests = require("Module:UnitTests")

local m_syllables = require("Module:syllables")

local langObjects = {}

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

function tests:check(example, expected, langCode)
	if not langObjects then
		langObjects = require("Module:languages").getByCode(langCode)
	end
	self:equals(tag(example),
		m_syllables.getVowels(example, langObjects),
		expected)
end

function tests:test()
	local examples = {
		{ "/noʊ ˈhaɪweɪ ˈkaʊboɪz/", 5, "en" },
		{ "ðɛɚ", 2, "en" },
		{ "ðɛɹ", 1, "en" },
		{ "/avə(ʊ)ˈkeɪʃən/", 4, "en" },
		{ "/-eɪʃəs/", nil, "en"},
		{ "/ɛː.e.lí.o͜i.o/", 5, "grc" },
		{ "/vl̩k/", 1, "cs" },
		{ "/ˈɑːmiɑi̯smɑjoi̯tus/", 6, "fi" },
		{ "/ˈɛi̯ərə(n)/", 3, "nl" },
	}
	
	tests:iterate(examples, "check")
end

return tests