def pluralize(word, pos=NOUN, gender=MALE, role=SUBJECT, custom={}):
w = word.lower().capitalize()<EOL>if word in custom:<EOL><INDENT>return custom[word]<EOL><DEDENT>if pos == NOUN:<EOL><INDENT>for a, b in plural_inflections:<EOL><INDENT>if w.endswith(a):<EOL><INDENT>return w[:-len(a)] + b<EOL><DEDENT><DEDENT>if w.startswith("<STR_LIT>"):<EOL><INDENT>return w<EOL><DEDENT>if w.endswith("<STR_LIT>"):<EOL><INDENT>return w<EOL><DEDENT>if w.endswith("<STR_LIT:e>"):<EOL><INDENT>return w + "<STR_LIT:n>"<EOL><DEDENT>if w.endswith("<STR_LIT>"):<EOL><INDENT>return w[:-<NUM_LIT:2>] + "<STR_LIT>"<EOL><DEDENT>if w.endswith(("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", u"<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT:u>")):<EOL><INDENT>return w<EOL><DEDENT>if w.endswith(("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>")):<EOL><INDENT>return w + "<STR_LIT>"<EOL><DEDENT>if w.endswith("<STR_LIT>"):<EOL><INDENT>return w + "<STR_LIT>"<EOL><DEDENT>if w.endswith("<STR_LIT>"):<EOL><INDENT>return w + "<STR_LIT>"<EOL><DEDENT>if w.endswith(("<STR_LIT>", "<STR_LIT>", "<STR_LIT>")):<EOL><INDENT>return w + "<STR_LIT>"<EOL><DEDENT>if w.endswith("<STR_LIT:o>"):<EOL><INDENT>return w + "<STR_LIT:s>"<EOL><DEDENT>if w.endswith("<STR_LIT:a>"):<EOL><INDENT>return w[:-<NUM_LIT:1>] + "<STR_LIT>"<EOL><DEDENT>if w.endswith(("<STR_LIT:all>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>")):<EOL><INDENT>umlaut = w[-<NUM_LIT:3>]<EOL>umlaut = umlaut.replace("<STR_LIT:a>", u"<STR_LIT>")<EOL>umlaut = umlaut.replace("<STR_LIT:o>", u"<STR_LIT>")<EOL>umlaut = umlaut.replace("<STR_LIT:u>", u"<STR_LIT>")<EOL>return w[:-<NUM_LIT:3>] + umlaut + w[-<NUM_LIT:2>:] + "<STR_LIT:e>"<EOL><DEDENT>for a, b in (<EOL>("<STR_LIT>",  u"<STR_LIT>"), <EOL>("<STR_LIT>", u"<STR_LIT>"), <EOL>("<STR_LIT>", u"<STR_LIT>"), <EOL>("<STR_LIT>", u"<STR_LIT>"), <EOL>("<STR_LIT>", u"<STR_LIT>")):<EOL><INDENT>if w.endswith(a):<EOL><INDENT>return w[:-len(a)] + b<EOL><DEDENT><DEDENT>return w + "<STR_LIT:e>"<EOL><DEDENT>return w<EOL>
Returns the plural of a given word.
        The inflection is based on probability rather than gender and role.