NAME
Lingua::EN::WordsToNumbers - convert numbers written in English to actual numbers
DESCRIPTION
This module is an OO wrapper for Lingua::EN::Words2Nums, which is very nice, but has an unfortunate name (which doesn't help when you're searching CPAN for modules that turn words into numbers).
SYNOPSIS
use Lingua::EN::WordsToNumbers;
my $numberizer = Lingua::EN::WordsToNumbers->new;
print $numberizer->parse("Forty-two"); # "42"
$numberizer->debug(1); # debug on
$numberizer->debug(undef); # debug off
$numberizer->billion(10**12); # use "English billion"
METHODS
new
my $numberizer = Lingua::EN::WordsToNumbers->new;
Gives you a new "object". Doesn't really do much.
parse
print $numberizer->parse("Forty-two"); # "42"
An alias for Lingua::EN::Words2Nums's words2nums
method. Read that module's documentation to see how it works. You can also call this method as words2nums
if you really want to.
debug
$numberizer->debug(1);
Set Lingua::EN::Words2Nums debug mode. True values are on, anything else is off.
billion
$numberizer->billion(10**12);
Define the value of a billion ($Lingua::EN::Words2Nums::billion
).
AUTHOR
Earle Martin <EMARTIN@cpan.org>
CREDITS
Thanks to Joey Hess (JOEY) for writing Lingua::EN::Words2Nums which does the real work.
This module was jointly conceived with Leon Brocard (LBROCARD) one lunchtime.
LICENSE
This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/1.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.