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::Number::IsOrdinal(3) User Contributed Perl Documentation Lingua::EN::Number::IsOrdinal(3)

Lingua::EN::Number::IsOrdinal - detect if English number is ordinal or cardinal

    use Lingua::EN::Number::IsOrdinal 'is_ordinal';

    ok is_ordinal('first');

    ok !is_ordinal('one');

    ok is_ordinal('2nd');

    ok !is_ordinal('2');

This module will tell you if a number, either in words or as digits, is a cardinal or ordinal number <http://www.ego4u.com/en/cram-up/vocabulary/numbers/ordinal>.

This is useful if you e.g. want to distinguish these types of numbers found with Lingua::EN::FindNumber and take different actions.

Takes a number as English words or digits (with or without ordinal suffix) and returns 1 for ordinal numbers and "undef" for cardinal numbers.

Checks that the whole parameter is a number using Lingua::EN::FindNumber or a regex in the case of digits, and if it isn't will throw a "not a number" exception.

This function can be optionally imported.

Method version of "is_ordinal", this is where the function is actually implemented. Can be overloaded in a subclass.

Returns 1 if the passed in string is a word-number as detected by Lingua::EN::FindNumber or is a cardinal or ordinal number made of digits and (for ordinal numbers) a suffix. Otherwise returns "undef". Can be overloaded in a subclass.

  • Lingua::EN::FindNumber
  • Lingua::EN::Words2Nums
  • Lingua::EN::Inflect::Phrase

Rafael Kitover <rkitover@cpan.org>

Copyright 2013-2015 by Rafael Kitover

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2015-03-23 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.