diff --git a/pattern/text/en/inflect.py b/pattern/text/en/inflect.py index 1b76a87d..2fb7a8b5 100644 --- a/pattern/text/en/inflect.py +++ b/pattern/text/en/inflect.py @@ -488,6 +488,7 @@ def pluralize(word, pos=NOUN, custom={}, classical=True): (r"([^d]ea)ves$" , "\\1f" ), (r"arves$" , "arf" ), (r"erves$" , "erve" ), + (r"([\w])lives" , "\\1live" ), (r"([nlw]i)ves$" , "\\1fe" ), (r'(?i)([lr])ves$' , '\\1f' ), (r"([aeo])ves$" , "\\1ve" ), @@ -572,8 +573,7 @@ def pluralize(word, pos=NOUN, custom={}, classical=True): "occipita": "occiput", "octopodes": "octopus", "opera": "opus", - "opuses": "opus", - "our": "my", + "opuses": "opus", "oxen": "ox", "penes": "penis", "penises": "penis", @@ -587,6 +587,10 @@ def pluralize(word, pos=NOUN, custom={}, classical=True): "zoa": "zoon", } +singular_pronouns = { + "our": "my", +} + def singularize(word, pos=NOUN, custom={}): """ Returns the singular of a given word. """ @@ -613,6 +617,9 @@ def singularize(word, pos=NOUN, custom={}): for x in singular_irregular: if w.endswith(x): return re.sub('(?i)'+x+'$', singular_irregular[x], word) + for x in singular_pronouns: + if w == x: + return singular_pronouns[x] for suffix, inflection in singular_rules: m = suffix.search(word) g = m and m.groups() or []