1Number(3) User Contributed Perl Documentation Number(3)
2
3
4
6 Lingua::EN::Inflect::Number - Force number of words to singular or plu‐
7 ral
8
10 use Lingua::EN::Inflect::Number qw(
11 number to_S to_PL # Or anything you want from Lingua::EN::Inflect
12 );
13
14 print number("goat"); # "s" - there's only one goat
15 print number("goats"); # "p" - there's several goats
16 print number("sheep"); # "ambig" - there could be one or many sheep
17
18 print to_S("goats"); # "goat"
19 print to_PL("goats"); # "goats" - it already is
20 print to_S("goat"); # "goat" - it already is
21 print to_S("sheep"); # "sheep"
22
24 This module extends the functionality of Lingua::EN::Inflect with three
25 new functions available for export:
26
27 number
28
29 This takes a word, and determines its number. It returns "s" for singu‐
30 lar, "p" for plural, and "ambig" for words that can be either singular
31 or plural.
32
33 Based on that:
34
35 to_S / to_PL
36
37 These take a word and convert it forcefully either to singular or to
38 plural. "Lingua::EN::Inflect" does funny things if you try to pluralise
39 an already-plural word, but this module does the right thing.
40
42 The whole concept is based on several undocumented features and
43 idiosyncracies in the way Lingua::EN::Inflect works. Because of this,
44 the module only works reliably on nouns. It's also possible that these
45 idiosyncracies will be fixed at some point in the future and this mod‐
46 ule will need to be rethought. But it works at the moment. Addition‐
47 ally, any disclaimers on Lingua::EN::Inflect apply double here.
48
50 Simon Cozens, "simon@cpan.org"
51
53 Lingua::EN::Inflect.
54
55
56
57perl v5.8.8 2004-02-28 Number(3)