Math::NumSeq::AlphabeticalLength -- length of numbers written in words
use Math::NumSeq::AlphabeticalLength; my $seq = Math::NumSeq::AlphabeticalLength->new; my ($i, $value) = $seq->next;
This sequence is how many letters when i is written out in words.
starting i=1 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8, ...
For example i=3 is value 5 because "three" has 5 letters. Only letters are counted. Spaces, hyphenation or accenting is ignored.
The default is English, or the
lang option can select anything known to Lingua::Any::Numbers. For example French, where i=2 has value 4 for 4 letters for "deux".
lang => 'fr' 2, 4, 5, 6, 4, 3, 4, 4, 4, 3, 4, 5, 6, 8, ...
The default is to include "and" conjunctions, but the
conjunctions option can exclude them
conjunctions => 0 ... 10, 10, 13, 13, ...
The first difference is at i=101 which is "one hundred one" value 13, whereas with conjunctions it's "one hundred and one" value 16.
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::AlphabeticalLength->new ()
$seq = Math::NumSeq::AlphabeticalLength->new (lang => $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.
Some of the modules used by
Lingua::Any::Numbers return utf-8 bytes and the
length() of word chars (regexp "\w") in that case is not the length in letters. The current code decodes utf-8 from "Lingua::SV::Numbers", but other language modules might give incorrect lengths.
Copyright 2012, 2015 Kevin Ryde
Math-NumSeq-Alpha 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-Alpha 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-Alpha. If not, see http://www.gnu.org/licenses/.