Module:siwa-headword: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 347: Line 347:
-- If `best_guess` is given and the POS is in neither the lemma nor non-lemma list, guess
-- If `best_guess` is given and the POS is in neither the lemma nor non-lemma list, guess
-- based on whether it ends in " forms"; otherwise, return nil.
-- based on whether it ends in " forms"; otherwise, return nil.
function pos_lemma_or_nonlemma(plpos, best_guess)
function pos_lemma_or_nonlemma(plpos)
-- Is it a lemma category?
-- Is it a lemma category?
if isLemma[plpos] or isLemma[plpos:gsub("^reconstructed ", "")] then
if isLemma[plpos] or isLemma[plpos:gsub("^reconstructed ", "")] then
Line 354: Line 354:
elseif isNonLemma[plpos] then
elseif isNonLemma[plpos] then
return "non-lemma form"
return "non-lemma form"
elseif best_guess then
return plpos:find(" forms$") and "non-lemma form" or "lemma"
else
else
return nil
return nil