Editing Module:D'ni Tools

From Guild of Archivists
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 193: Line 193:


     local output  
     local output  
    local name = 'quote'..count


     local word = mw.text.trim(input)
     local word = mw.text.trim(input)
Line 216: Line 214:
     elseif (first == '-') then
     elseif (first == '-') then
         output = prefix..'[[Dictionary:'..word..'|'..mw.ustring.sub(word,2,-1)..']]'..suffix
         output = prefix..'[[Dictionary:'..word..'|'..mw.ustring.sub(word,2,-1)..']]'..suffix
         mw.smw.subobject('ContainsTerm=Dictionary:'..word,name)
         mw.smw.subobject('ContainsTerm=Dictionary:'..word,count)
     elseif (last == '-') then
     elseif (last == '-') then
         output = prefix..'[[Dictionary:'..word..'|'..mw.ustring.sub(word,1,-2)..']]'..suffix
         output = prefix..'[[Dictionary:'..word..'|'..mw.ustring.sub(word,1,-2)..']]'..suffix
         mw.smw.subobject('ContainsTerm=Dictionary:'..word,name)
         mw.smw.subobject('ContainsTerm=Dictionary:'..word,count)
     elseif (first == '.' or first == '!' or first == '?' or first == ',') then
     elseif (first == '.' or first == '!' or first == '?' or first == ',') then
         output = first..prefix..'[[Dictionary:'..mw.ustring.sub(word,2,-1)..'|'..mw.ustring.sub(word,2,-1)..']]'..suffix
         output = first..prefix..'[[Dictionary:'..mw.ustring.sub(word,2,-1)..'|'..mw.ustring.sub(word,2,-1)..']]'..suffix
         mw.smw.subobject('ContainsTerm=Dictionary:'..mw.ustring.sub(word,1,-2),name)
         mw.smw.subobject('ContainsTerm=Dictionary:'..mw.ustring.sub(word,1,-2),count)
     elseif (last == ',') then
     elseif (last == ',') then
         output = prefix..'[[Dictionary:'..mw.ustring.sub(word,1,-2)..'|'..mw.ustring.sub(word,1,-2)..']]'..suffix..last
         output = prefix..'[[Dictionary:'..mw.ustring.sub(word,1,-2)..'|'..mw.ustring.sub(word,1,-2)..']]'..suffix..last
         mw.smw.subobject('ContainsTerm=Dictionary:'..mw.ustring.sub(word,1,-2),name)
         mw.smw.subobject('ContainsTerm=Dictionary:'..mw.ustring.sub(word,1,-2),count)
     else
     else
         output = prefix..'[[Dictionary:'..word..'|'..word..']]'..suffix
         output = prefix..'[[Dictionary:'..word..'|'..word..']]'..suffix
         mw.smw.subobject('ContainsTerm=Dictionary:'..word,name)
         mw.smw.subobject('ContainsTerm=Dictionary:'..word,count)
     end
     end


Please note that all contributions to Guild of Archivists may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see GoArch:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: