def plural(noun):
"""Roughly apply the rules of pluralization."""
vowels = 'aeiou'
irregular = {
'child':'children',
'foot':'feet',
'man':'men',
'mouse':'mice',
'ox':'oxen',
'person':'people',
'tooth':'teeth',
'woman':'women',
}
nl = noun.lower()
## is it too short to juggle?
if len(nl) < 2:
return noun + 's'
## Check for an irregular noun
if nl in irregular:
return irregular[nl]
suffix = 's'
if nl[-2:] in ('ss', 'sh', 'ch') or nl[-1:] in ('x','z'):
suffix = 'es'
elif nl.endswith('y'):
if nl[-2] not in vowels:
noun = noun[:-1]
suffix = 'ies'
elif nl.endswith('f'):
noun = noun[:-1]
suffix = 'ves'
elif nl.endswith('o'):
if nl[-2] not in vowels:
suffix = 'es'
return noun + suffix