use Lingua::EN::PluralToSingular qw/plural2singular/; my $s = plural2singular ('menus'); # $s = 'menu' (removed final s) my $s = plural2singular ('citrus'); # $s = 'citrus' (no change) my $s = plural2singular ('fries'); # $s = 'fry' (ies->y) my $s = plural2singular ('species'); # $s = 'species' (no change) my $s = plural2singular ('children'); # $s = 'child' (irregular plurals, also mice, women, etc.)
A module which deals with all the exasperating edge cases of converting English plural nouns to English singular nouns.
It needs to know the irregular plurals of English such as "mice" and "children" as well as being able to distinguish words like "Charles" and "citrus" from words like "miles" and "menus", and also to be able to deal with plurals like "fries" and "sandwiches".
The module probably needs to have some dictionary of words built in or to depend on another module which has some knowledge of English vocabulary.
knives -> knife, also wolves -> wolf, roofs -> roof.