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

Lingua::EN::FindNumber - Locate (written) numbers in English text

  use Lingua::EN::FindNumber;
  my $text = "Fourscore and seven years ago, our four fathers...";

  numify($text); # "87 years ago, our 4 fathers..."

  @numbers = extract_numbers($text); # "Fourscore and seven", "four"

  while ($text =~ /$number_re/g) { # Build your own iterator

This module provides a regular expression for finding numbers in English text. It also provides functions for extracting and manipulating such numbers.

  numify($text); # "87 years ago, our 4 fathers..."

  @numbers = extract_numbers($text); # "Fourscore and seven", "four"

  while ($text =~ /$number_re/g) { # Build your own iterator

This module was written for the Natural Languages chapter of the second edition of Advanced Perl Programming.

This module works rather well in conjunction with Lingua::EN::Words2Nums, which is a very cool module anyway. (And Simon stole some of this module's code from it. Thanks, Joey!) It may also be involved with Lingua::EN::NamedEntity in the future, so check that one out too.

<https://github.com/neilb/Lingua-EN-FindNumber>

This module was originally written by Simon Cozens. It was then maintained from 2004 to 2005 by Tony Bowden. Since 2014 it has been maintained by Neil Bowers.

Please direct all correspondence regarding this module to: bug-Lingua-EN-Number@rt.cpan.org

Copyright 2003-2005 by Simon Cozens

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

2015-10-25 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.