1 of 38 tests failed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
arbo | nouns | nouns | |
arbon | noun forms | noun forms | |
arboj | noun forms | noun forms | |
arbojn | noun forms | noun forms | |
blua | adjectives | adjectives | |
akurata | adjectives | adjectives | |
bluan | adjective forms | adjective forms | |
bluaj | adjective forms | adjective forms | |
bluajn | adjective forms | adjective forms | |
larĝe | adverbs | adverbs | |
manĝi | verbs | verbs | |
manĝu | verb forms | verb forms | |
manĝas | verb forms | verb forms | |
manĝis | verb forms | verb forms | |
manĝos | verb forms | verb forms | |
manĝus | verb forms | verb forms | |
manĝanta | participles | participles | |
manĝantan | participles | participles | |
manĝantaj | participles | participles | |
manĝantajn | participles | participles | |
manĝonta | participles | participles | |
manĝontan | participles | participles | |
manĝontaj | participles | participles | |
manĝontajn | participles | participles | |
manĝata | participles | participles | |
manĝante | participles | participles | |
ablativo absoluta | nouns | nouns | |
damna metalroko | nouns | nouns | |
ŭato | nouns | nouns | |
mito | nouns | nouns | |
azoto | nouns | nouns | |
monato | nouns | nouns | |
mia nomo estas | phrases | nouns | |
9a | adjectives | adjectives | |
9an | adjective forms | adjective forms | |
20-a | adjectives | adjectives | |
20-aj | adjective forms | adjective forms | |
20-ajn | adjective forms | adjective forms |
local tests = require "Module:UnitTests"
local full_link = require "Module:links".full_link
local lang = require "Module:languages".getByCode "eo"
local function link(word)
return full_link { term = word, lang = lang }
end
function tests:test_getPOS()
local examples = {
{ "arbo", "nouns" },
{ "arbon", "noun forms" },
{ "arboj", "noun forms" },
{ "arbojn", "noun forms" },
{ "blua", "adjectives" },
{ "akurata", "adjectives" },
{ "bluan", "adjective forms" },
{ "bluaj", "adjective forms" },
{ "bluajn", "adjective forms" },
{ "larĝe", "adverbs" },
{ "manĝi", "verbs" },
{ "manĝu", "verb forms" },
{ "manĝas", "verb forms" },
{ "manĝis", "verb forms" },
{ "manĝos", "verb forms" },
{ "manĝus", "verb forms" },
{ "manĝanta", "participles" },
{ "manĝantan", "participles" },
{ "manĝantaj", "participles" },
{ "manĝantajn", "participles" },
{ "manĝonta", "participles" },
{ "manĝontan", "participles" },
{ "manĝontaj", "participles" },
{ "manĝontajn", "participles" },
{ "manĝata", "participles" },
{ "manĝante", "participles" },
{ "ablativo absoluta", "nouns" },
{ "damna metalroko", "nouns" },
{ "ŭato", "nouns" },
{ "mito", "nouns" },
{ "azoto", "nouns" },
{ "monato", "nouns" },
{ "mia nomo estas", "phrases" }, -- or nil?
{ "9a", "adjectives" },
{ "9an", "adjective forms" },
{ "20-a", "adjectives" },
{ "20-aj", "adjective forms" },
{ "20-ajn", "adjective forms" },
--[[
-- Copy this to add another term and its POS category:
{ "", "" },
--
--]]
}
local getPOS = require "Module:eo-headword".getPOS
self:iterate(examples,
function (self, word, poscat)
self:equals(link(word), getPOS(word), poscat)
end)
end
return tests