The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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.

LEGAL

Copyright 2004 Earle Martin. All Rights Reserved.

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