View on
Ben Bullock > Lingua-EN-PluralToSingular-0.18 > Lingua::EN::PluralToSingular



Annotate this POD


View/Report Bugs
Module Version: 0.18   Source   Latest Release: Lingua-EN-PluralToSingular-0.19


Lingua::EN::PluralToSingular - change an English plural to a singular


    use Lingua::EN::PluralToSingular 'to_singular';
    print to_singular ('knives');
    # "knife"
    use Lingua::EN::PluralToSingular 'is_plural';
    # Returns 1
    is_plural ('sheep');
    # Returns 0
    is_plural ('dog');
    # Returns 1
    is_plural ('dogs');
    # Returns 0
    is_plural ('cannabis');


This documents version 0.18 of Lingua::EN::PluralToSingular corresponding to git commit 62ecc4aca6e71b6dcdbde9db8bdd5cdf50a9bc9b released on Mon Feb 8 16:15:11 2016 +0900.


This converts words denoting a plural in the English language into words denoting a singular noun.



    my $singular = to_singular ($word);

Convert $word into its singular form. For example,

    to_singular ('cats')

returns 'cat'. If the word is unknown or does not seem to be plural, to_singular returns the word itself, so

    to_singular ('battlehorn');

returns 'battlehorn'.


    if (is_plural ($word)) {
        print "There are too many $word here.\n";
    else {
        print "There is a $word here.\n";

Returns 1 if the word is a valid plural, 0 if not. It also returns 1 for ambiguous words like "sheep".


Assumes the input is a noun

"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".

Distinguishes lower and upper case

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,

    to_singular ('FLIES');

returns 'FLIES' and

    to_singular ('Wolves');

returns 'Wolve'. Similarly,

    to_singular ('Charles');

returns 'Charles', but

    to_singular ('charles');

returns 'charle', since the exception only applies if the word is capitalized.

Does not handle pronouns

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".


See also "LIMITATIONS" above.

This module is in development, and there are many exceptions which are not included yet. Also my criterion for including words is basically my own knowledge, so a lot of words I didn't recognize in the dictionary haven't been entered yet.



Lingua::EN::Inflect by Damian Conway converts English singular nouns to plurals, but not vice-versa.


Lingua::EN::Inflect::Number is supposed to do the same thing as this module. However, as of the time of writing (version 1.12) it's actually based on the third-person verb handling of Lingua::EN::Inflect, in other words it takes a verb in the "he says" form and converts it into "say". Thus you get bugs like where the reporter demonstrates that 'to_S incorrectly renders the singular of "statuses" as "statuse."'


Thanks to Xan Charbonnet and H2CHANG for various additions and fixes. Lisa Hare contributed support for plurals ending in i as part of the 2016 Pull Request Challenge.


Ben Bullock, <>


If you'd like to see this module continued, let me know that you're using it. For example, send an email, write a bug report, star the project's github repository, add a patch, add a ++ on, or write a rating at CPAN ratings. It really does make a difference. Thanks.


This package and associated files are copyright (C) 2011-2016 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.

syntax highlighting: