local export = {}
local lemmas = {
["abbreviation"] = true,
["acronym"] = true,
["adjective"] = true,
["adposition"] = true,
["adverb"] = true,
["affix"] = true,
["article"] = true,
["circumfix"] = true,
["circumposition"] = true,
["classifier"] = true,
["cmavo"] = true,
["cmavo cluster"] = true,
["cmene"] = true,
["conjunction"] = true,
["contraction"] = true,
["counter"] = true,
["determiner"] = true,
["diacritical mark"] = true,
["fu'ivla"] = true,
["gismu"] = true,
["Han tu"] = true,
["hanzi"] = true,
["hanja"] = true,
["idiom"] = true,
["infix"] = true,
["interfix"] = true,
["initialism"] = true,
["interjection"] = true,
["kanji"] = true,
["letter"] = true,
["ligature"] = true,
["lujvo"] = true,
["morpheme"] = true,
["non-constituent"] = true,
["noun"] = true,
["number"] = true,
["numeral"] = true,
["particle"] = true,
["phrase"] = true,
["postposition"] = true,
["predicative"] = true,
["prefix"] = true,
["preposition"] = true,
["prepositional phrase"] = true,
["preverb"] = true,
["pronoun"] = true,
["proverb"] = true,
["proper noun"] = true,
["punctuation mark"] = true,
["root"] = true,
["suffix"] = true,
["syllable"] = true,
["symbol"] = true,
["verb"] = true,
}
local nonlemmas = {
["active participle"] = true,
["adjectival participle"] = true,
["adjective form"] = true,
["adjective comparative form"] = true,
["adjective superlative form"] = true,
["adverb form"] = true,
["adverb comparative form"] = true,
["adverb superlative form"] = true,
["adverbial participle"] = true,
["agent participle"] = true,
["article form"] = true,
["circumfix form"] = true,
["combined form"] = true,
["comparative adjective"] = true,
["comparative adverb"] = true,
["determiner comparative form"] = true,
["determiner form"] = true,
["determiner superlative form"] = true,
["diminutive noun"] = true,
["gerund"] = true,
["infinitive"] = true,
["jyutping"] = true,
["kanji reading"] = true,
["misspelling"] = true,
["negative participle"] = true,
["nominal participle"] = true,
["noun case form"] = true,
["noun form"] = true,
["noun plural form"] = true,
["numeral form"] = true,
["participle"] = true,
["participle form"] = true,
["particle form"] = true,
["passive participle"] = true,
["past active participle"] = true,
["past participle"] = true,
["past participle form"] = true,
["past passive participle"] = true,
["perfect active participle"] = true,
["perfect passive participle"] = true,
["pinyin"] = true,
["plural"] = true,
["postposition form"] = true,
["prefix form"] = true,
["preposition contraction"] = true,
["preposition form"] = true,
["prepositional pronoun"] = true,
["present active participle"] = true,
["present participle"] = true,
["present passive participle"] = true,
["pronoun form"] = true,
["proper noun form"] = true,
["rafsi"] = true,
["romanization"] = true,
["romaji"] = true,
["singulative"] = true,
["suffix form"] = true,
["superlative adjective"] = true,
["superlative adverb"] = true,
["verb form"] = true,
["verbal noun"] = true,
}
local invariable = {
if pos then
if lemmas[pos] or lemmas[pos:gsub("^reconstructed ", "")] then
table.insert(categories, lang:getCanonicalName() .. " lemmas")
elseif nonlemmas[pos] or nonlemmas[pos:gsub("^reconstructed ", "")] or lemmas[pos:gsub("^mutated ", "")] or nonlemmas[pos:gsub("^mutated ", "")] then
table.insert(categories, lang:getCanonicalName() .. " non-lemma forms")
else
table.insert(tracking_categories, "head tracking/unrecognized pos")
end
-- Make the plural form of the part of speech
if pos:find("x$") then
table.insert(categories, lang:getCanonicalName() .. " " .. pos .. (cat_sc and " in " .. cat_sc:getCategoryName() or ""))
elseif lang:getCode() ~= "und" then
table.insert(tracking_categories, "head tracking/no pos")
end