Lingua:...::Number(3)
okay bestie, welcome to the Lingua:...::Number(3) page from the User Contributed Perl Documentation π This is the manual for Lingua::EN::Inflect::Number, and itβs lowkey here to help you force words into singular or plural mode without the chaos. Periodt.
π¦ NAME π¦
Lingua::EN::Inflect::Number β Force number of words to singular or plural. Thatβs the whole assignment, no cap. π
π» SYNOPSIS π»
Hereβs the group-chat demo, literally straight from the page:
use Lingua::EN::Inflect::Number qw(
number to_S to_PL # Or anything you want from Lingua::EN::Inflect
);
print number("goat"); # "s" - there's only one goat
print number("goats"); # "p" - there's several goats
print number("sheep"); # "ambig" - there could be one or many sheep
print to_S("goats"); # "goat"
print to_PL("goats"); # "goats" - it already is
print to_S("goat"); # "goat" - it already is
print to_S("sheep"); # "sheep"
πΈ DESCRIPTION πΈ
This module extends the functionality of Lingua::EN::Inflect with three new functions available for export:
π’ number
This takes a word, and determines its number. It returns "s" for singular, "p" for plural, and "ambig" for words that can be either singular or plural.
Based on that:
π«Ά to_S / to_PL
These take a word and convert it forcefully either to singular or to plural. Lingua::EN::Inflect does funny things if you try to pluralise an already-plural word, but this module does the right thing.
β οΈ DISCLAIMER β οΈ
okay bestie, listen up, because this is the βbe carefulβ corner π«Ά
The whole concept is based on several undocumented features and idiosyncracies in the way Lingua::EN::Inflect works. Because of this, the module only works reliably on nouns. Itβs also possible that these idiosyncracies will be fixed at some point in the future and this module will need to be rethought. But it works at the moment. Additionally, any disclaimers on Lingua::EN::Inflect apply double here.
π SEE ALSO π
Lingua::EN::Inflect β thatβs the one to see also, bestie. π
π¦ REPOSITORY π¦
The repo is right here: https://github.com/neilbowers/Lingua-EN-Inflect-Number
π AUTHOR π
Simon Cozens, simon@cpan.org β iconic behavior, honestly. π
βοΈ COPYRIGHT AND LICENSE βοΈ
This software is copyright (c) 2004 by Simon Cozens simon@cpan.org
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
xoxo, the footer said: perl v5.42.0 Β· 2015-07-07 Β· Lingua:...::Number(3) β bye bestie, go pluralise responsibly π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Lingua-EN-Inflect-Number 1.12-bp160.1.11 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms