Module:Grammar: Difference between revisions

246 bytes added ,  17:18, 1 October 2019
m
no edit summary
(split conjugate into its own module so both grammar and htmlparse can use)
mNo edit summary
Line 17: Line 17:
       pronoun = pronounresult
       pronoun = pronounresult
   end
   end
end
if pronouns[pronoun] == nil then
  error ("There was no pronoun set named " .. (pronoun or "(no pronoun)").. "!")
end
end


Line 66: Line 69:
       end
       end
   elseif (a == "verb") then
   elseif (a == "verb") then
       if (c == nil or c == '') then
       if (c == nil or c == '') then --[if no :afterpronoun]
         returnstring = conjugate.singularverb(b)
         returnstring = conjugate.singularverb(b)
       elseif (p.isplural(gender,pronoun) == '0') then
       elseif (p.isplural() == '0') then --[if not plural, singularize]
         returnstring = conjugate.singularverb(b)
         returnstring = conjugate.singularverb(b)
       else  
       else  
Line 93: Line 96:


function p.isplural(gender,pronoun)
function p.isplural(gender,pronoun)
    if (pronoun~=nil) then
      return pronouns[pronoun]['pseudoplural']
    end
     if progentable["pseudoplural"] == '1' or progentable["plural"] == '1' then
     if progentable["pseudoplural"] == '1' or progentable["plural"] == '1' then
       return '1'
       return '1'
Line 101: Line 107:


function p.test()
function p.test()
  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."
  text="Before you =verb:recline= =article==pronouns.personTerm= clothed in leafy raiment, so svelte and still you mistake =pronouns.objective= for the fallen branch of a sickly tree until you meet the gaze of =pronouns.possessive= cerulean eyes. Upon closer scrutiny, you discern the hilts of =pronouns.possessive= twin swords, Caslainard and Polluxus, rising through the foliage of =pronouns.possessive= cloak and over =pronouns.possessive= shoulders. =pronouns.Possessive= sylvan sashes, of which =pronouns.subjective= =verb:wear:afterpronoun= several, are strewn with the ears, claws, and horns of creatures unfamiliar to you, and as you examine them, =pronouns.subjective= =verb:scrutinize:afterpronoun= you wearing an expression that bears qualities of both a smirk and a scowl yet that is not quite either."
gender = "male"
gender = "male"
pronoun = "he/him/his/his/himself/god/godling/lord/son/brother/father"
pronoun = ""


local f = {["args"] = {[1]= text, [2] = gender, [3] = pronoun }}
local f = {["args"] = {[1]= text, [2] = gender, [3] = pronoun }}