Lingua::EN::WordsToNumbers 0.11 review

Download
by rbytes.net on

Lingua::EN::WordsToNumbers is Perl module to convert numbers written in English to actual numbers. This module is an OO wrapper fo

License: Perl Artistic License
File size: 2K
Developer: Earle Martin
0 stars award from rbytes.net

Lingua::EN::WordsToNumbers is Perl module to convert numbers written in English to actual numbers.

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).

Requirements:
Perl

Lingua::EN::WordsToNumbers 0.11 search tags