Skip Menu |

This queue is for tickets about the Lingua-EN-Inflect CPAN distribution.

Report information
The Basics
Id: 105331
Status: open
Priority: 0/
Queue: Lingua-EN-Inflect

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.899
Fixed in: (no value)



Subject: PL 'unconditionally forms the plural', except when it forms the singular
The documentation suggests that PL makes the plural form of a noun. But if given one which is already plural, it usually returns the singular again: perl -E 'use Lingua::EN::Inflect "PL"; say PL("country"); say PL("countries")' countries country I can't see this documented anywhere.
Subject: Re: [rt.cpan.org #105331] PL 'unconditionally forms the plural', except when it forms the singular
Date: Fri, 19 Jun 2015 07:24:01 +1000
To: bug-Lingua-EN-Inflect [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> The documentation suggests that PL makes the plural form of a noun.
The documentation actually states: The exportable subroutine C<PL()> takes a I<singular> English noun, pronoun, verb, or adjective and returns its plural form. In other words, it only works if the argument is singular. Show quoted text
> But if given one which is already plural, it usually returns the singular
again: Unfortunately, this is a (mis-)feature of English. Singular verbs inflect like plural nouns and vice versa. So when you: Show quoted text
> say PL("countries")
the module assumes that's a verb (since singular verbs usually end in -s in English) and so inflects it to the plural form. Of course, "to country" is rather an esoteric verb; more regular examples would be: say PL("comforts"); # she/he/it comforts --> they comfort say PL("counters"); # she/he/it counters --> they counter say PL("controls"); # she/he/it controls --> they control # etc. The bottom line is that all of the PL_...() subs expect a singular word as their argument, so they won't work (as you expect) if you given them (what you think is) a plural. The Lingua::EN::Inflect module has many other deficiencies as well, which is why it is now in maintenance mode only (i.e. it's deprecated), and why I wrote the Lingua::EN::Inflexion module to replace it. That module has a completely different interface (in the hope of making these kinds of confusions much less likely). Using the module, you could write: use Lingua::EN::Inflexion; say noun('country')->plural; say noun('countries')->plural; which would print: countries countries as you were expecting. Damian