Simon Cozens > Lingua-EN-Inflect-Number-1.1 > Lingua::EN::Inflect::Number

Download:
Lingua-EN-Inflect-Number-1.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 1.1   Source  

NAME ^

Lingua::EN::Inflect::Number - Force number of words to singular or plural

SYNOPSIS ^

  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 ^

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.

AUTHOR ^

Simon Cozens, simon@cpan.org

SEE ALSO ^

Lingua::EN::Inflect.

syntax highlighting: