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

NAME

Math::NumSeq::AlphabeticalLength -- length of numbers written in words

SYNOPSIS

 use Math::NumSeq::AlphabeticalLength;
 my $seq = Math::NumSeq::AlphabeticalLength->new;
 my ($i, $value) = $seq->next;

DESCRIPTION

In progress ...

This is how many letters in each i written out in words. For example i=12 is value 6 because "twelve" has 6 letters.

    starting i=1
    3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8, ...

Only letters are counted. Any spaces, hyphenation or accenting is ignored.

Language

The default is English, or the language option can select anything known to Lingua::Any::Numbers. For example in French i=2 has value 4 for 4 letters in "deux".

    language => 'fr'
    2, 4, 5, 6, 4, 3, 4, 4, 4, 3, 4, 5, 6, 8, ...

FUNCTIONS

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.

$seq = Math::NumSeq::AlphabeticalLength->new ()
$seq = Math::NumSeq::AlphabeticalLength->new (language => $str)

Create and return a new sequence object.

$value = $seq->ith($i)

Return the number of letters in $i written out in the selected language.

BUGS

Some of the modules Lingua::Any::Numbers uses return utf-8 bytes. When this happens length() of "\w" word chars is not the length in letters. The current code notices and decodes "Lingua::SV::Numbers" utf-8, but other modules might give incorrect lengths.

SEE ALSO

Math::NumSeq, Math::NumSeq::DigitLength

Lingua::Any::Numbers

HOME PAGE

http://user42.tuxfamily.org/math-numseq/index.html

LICENSE

Copyright 2012 Kevin Ryde

Math-NumSeq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Math-NumSeq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.