GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Lingua::EN::Inflect::Number(3) User Contributed Perl Documentation Lingua::EN::Inflect::Number(3)

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

  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"

This module extends the functionality of Lingua::EN::Inflect with three new functions available for export:

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:

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.

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.

Lingua::EN::Inflect

<https://github.com/neilbowers/Lingua-EN-Inflect-Number>

Simon Cozens, "simon@cpan.org"

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.

2015-07-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.