User:SemperBlottoBot/nouns

Hello, you have come here looking for the meaning of the word User:SemperBlottoBot/nouns. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:SemperBlottoBot/nouns, but we will also tell you about its etymology, its characteristics and you will know how to say User:SemperBlottoBot/nouns in singular and plural. Everything you need to know about the word User:SemperBlottoBot/nouns you have here. The definition of the word User:SemperBlottoBot/nouns will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:SemperBlottoBot/nouns, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
  • itnouns.py
#coding: utf-8
"""
This module reads a file of Italian nouns and generates the plural forms of those that are probably regular.
"""
__version__='$Id: Exp $'

import wikipedia, config
import re, sys, codecs

mysite = wikipedia.getSite()
commenttext = 'Auto-generated Italian plurals'
global gender
global itnouns
itnouns = 

def doplural(singular, plural):
    global gender
    newpage = "==Italian==" + '\n\n' + "===Noun===" + '\n'
    newpage = newpage + "'''" + plural + "'''" + " {{" + gender + "}}" + '\n\n'
    newpage = newpage + "# {{plural of|]|lang=Italian}}"
    page = wikipedia.Page(mysite, plural)
    if page.exists():
        old_text = page.get()
        if not re.search(r'==\s*Italian\s*==', old_text):
            contents = old_text + '\n\n----\n'  + newpage + '\n{{rfc-auto}}\n'
            commenttext_add = commenttext + " - appended"
            wikipedia.output(u"Page %s already exists, adding to entry!"%plural)
            page.put(contents, comment = commenttext_add, minorEdit = False)
        else:
            wikipedia.output(u"Page %s already exists with Italian section, not adding!"%plural)
    else:
        page.put(newpage, comment = commenttext, minorEdit = True) # was False (see above)

def findplural(singular):
    global gender
    global itnouns
    page = wikipedia.Page(mysite, singular)
    text = page.get()
    x = text.find("{{it-noun|")
    if x == -1:
        print "No template found"
        itnouns.append(singular)
        return ""
    text = text
    x = text.find("}}")
    text = text
    x = text.find("|")
    stem = text
    text = text
    x = text.find("|")
    gender = text
    text = text
    while text.find("|") > 0:
        x = text.find("|")
        text = text
    plural = stem + text
    if plural < "a": #  Template generated nouns with multiple words
        plural = plural
    return plural

verbs = open('itnouns.txt', 'r')
singular = verbs.readline() # First line strange
while len(singular) > 1:
    singular = verbs.readline()
    if len(singular) > 1:
         plural = findplural(singular)
         if not plural == "":
            doplural(singular, plural)
verbs.close()
for I in itnouns:
    print I