Module:Grammar: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
local pronouns = require'Module:Grammar/PronounsTable' | local pronouns = require'Module:Grammar/PronounsTable' | ||
local genders = require'Module:Grammar/GenderTable' | local genders = require'Module:Grammar/GenderTable' | ||
local progentable = {} | |||
function p.Main(frame) | function p.Main(frame) | ||
Line 17: | Line 17: | ||
end | end | ||
end | end | ||
progentable = { | |||
["subjective"] = pronouns[pronoun]["subjective"], | |||
["objective"] = pronouns[pronoun]["objective"], | |||
["possessive"] = pronouns[pronoun]["possessive"], | |||
["substantivepossessive"] = pronouns[pronoun]["substantivepossessive"], | |||
["reflexive"] = pronouns[pronoun]["reflexive"], | |||
["pseudoplural"] = pronouns[pronoun]["pseudoplural"], | |||
["plural"] = pronouns[pronoun]["plural"] or genders[gender]["plural"], | |||
["personterm"] = pronouns[pronoun]["personterm"] or genders[gender]["personterm"], | |||
["immaturepersonterm"] = pronouns[pronoun]["immaturepersonterm"] or genders[gender]["immaturepersonterm"], | |||
["formaladdressterm"] = pronouns[pronoun]["formaladdressterm"] or genders[gender]["formaladdressterm"], | |||
["offspringterm"] = pronouns[pronoun]["offspringterm"] or genders[gender]["offspringterm"], | |||
["siblingterm"] = pronouns[pronoun]["siblingterm"] or genders[gender]["siblingterm"], | |||
["parentterm"] = pronouns[pronoun]["parentterm"] or genders[gender]["parentterm"] | |||
} | |||
parsedtext = string.gsub(frame.args[1], "=([^=]+)=", function(f) | parsedtext = string.gsub(frame.args[1], "=([^=]+)=", function(f) | ||
Line 42: | Line 58: | ||
end | end | ||
else | else | ||
local results = p.parse(b | local results = p.parse(b) | ||
if results == nil then | if results == nil then | ||
returnstring = "No results!" | returnstring = "No results!" | ||
Line 99: | Line 115: | ||
end | end | ||
function | local function parse(field, gender, pronoun) | ||
return progentable[field] | |||
end | end | ||
function | local function isplural(gender,pronoun) | ||
if progentable["pseudoplural"] == '1' or progentable["plural"] == '1' then | |||
return '1' | |||
else | else | ||
return '0' | |||
end | end | ||
end | end | ||
function | local function test(frame) | ||
local strippedstring = "j" | local strippedstring = "j" | ||
local argument = frame.args[1] | local argument = frame.args[1] |