Module:Grammar: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 58: Line 58:
           end
           end
       else  
       else  
         local results = parse(b, gender, pronoun)
         local results = p.parse(b, gender, pronoun)
         if results == nil then  
         if results == nil then  
  returnstring = "No results!"
  returnstring = "No results!"
Line 81: Line 81:
       else
       else


       local results = isplural(gender,pronoun)
       local results = p.isplural(gender,pronoun)
        
        
       if (results == '0') then
       if (results == '0') then
Line 115: Line 115:
end
end


local function parse(field, gender, pronoun)
function p.parse(field, gender, pronoun)
     return progentable[field]
     return progentable[field]
end
end


local function isplural(gender,pronoun)
function p.isplural(gender,pronoun)
     if progentable["pseudoplural"] == '1' or progentable["plural"] == '1' then
     if progentable["pseudoplural"] == '1' or progentable["plural"] == '1' then
       return '1'
       return '1'
Line 127: Line 127:
end
end


local function test(frame)
function p.test()
local strippedstring = "j"
text="You stand not at the foot of a wintry knoll but beneath a mountain of muscle, swathed in blanched fur, that must be nature's crowning jewel. Cast from the mold of the great apes (or perhaps the exemplar from which those apes were molded), the living god differs only in that =pronouns.subjective= =verb:bear:afterpronoun= not two but six arms, each of which might be the fleeced bole of an ancient yew. =pronouns.Possessive= fists are of proportions that suggest the might with which hoary gods beat the mountains into shape when the earth was young. However, =pronouns.possessive= aspect bears not a shred of that divine fury; =pronouns.subjective= =verb:don't:afterpronoun= rage but instead =verb:sit:afterpronoun= in contemplation of eons."
local argument = frame.args[1]
gender = "male"
for s in string.gmatch(argument, "=([^=]+)=") do
pronoun = "he/him/his/his/himself/god/godling/lord/son/brother/father"
strippedstring = strippedstring .. s
 
end
local f = {["args"] = {[1]= text, [2] = gender, [3] = pronoun }}
return strippedstring
return p.Main(f)
 
end
end


return p
return p