Modifiche
nessun oggetto della modifica
local export = {}
local lemmas = {
["adjective"] = true,
["adverb"] = true,
["conjunction"] = true,
["determiner"] = true,
["noun"] = true,
["numeral"] = true,
["preposition"] = true,
["verb"] = true,
}
local nonlemmas = {
["adjective form"] = true,
["adverb form"] = true,
["determiner form"] = true,
["noun form"] = true,
["numeral form"] = true,
["participle"] = true,
["plural"] = true,
["verb form"] = true,
}
function export.head_t(frame)
if cat then
table.insert(categories, lang:getCanonicalName() .. " " .. cat)
if pos then
table.insert(categories, "head tracking/with cat/with pos")
else
table.insert(categories, "head tracking/with cat/no pos")
end
elseif pos then
if lemmas[pos] then
table.insert(categories, lang:getCanonicalName() .. " lemmas")
elseif not nonlemmas[pos] then
table.insert(categories, "head tracking/unrecognized pos")
end
-- Make the plural form of the part of speech
if pos:find("x$") then
pos = pos .. "es"
elseif not (pos ~== "punctuationhanzi" or pos ~== "phrasebook" or pos == "punctuation") then
pos = pos .. "s"
end
table.insert(categories, lang:getCanonicalName() .. " " .. pos)
else
table.insert(categories, "head tracking/no pos")
end