Lingua::EN::PluralToSingular - change an English plural to a singular
use Lingua::EN::PluralToSingular 'to_singular'; print to_singular ('knives'); # "knife"
This converts words denoting a plural in the English language into words denoting a singular noun.
There is only one function.
my $singular = to_singular ($word);
$word into its singular form. For example,
returns 'cat'. If the word is unknown or does not seem to be plural,
to_singular returns the word itself, so
"to_singular" assumes its input is a noun. For example, "lives" may be the plural of "life", or the verb "live", as in "he lives". The routine assumes a noun and converts to "life".
It does not deal with capitalized words. If the input word may be capitalized, or if its initial letter may be capitalized, the user must preprocess it to put it into the normal case. So, for example,
returns 'FLIES' and
returns 'Wolve'. Similarly,
returns 'Charles', but
returns 'charle', since the exception only applies if the word is capitalized.
The module does not attempt to handle pronoun forms like "ourselves" or "themselves". These words are left unaltered.
The script scripts/singular provides a quick way to get singular versions of nouns:
singular cats dogs geese # Prints "cat dog goose".
This module is in development, and there are many exceptions which are not included yet.
Thanks to Xan Charbonnet and H2CHANG for various additions and fixes.
Ben Bullock, <email@example.com>
This package and associated files are copyright (C) 2012-2014 Ben Bullock.
You can use, copy, modify and redistribute this package and associated files under the Perl Artistic Licence or the GNU General Public Licence.