NAME
Lingua::TokiPona::Numbers - Convert numbers into Toki Pona words
VERSION
This document describes Lingua::TokiPona::Numbers version 0.02.
SYNOPSIS
use 5.010;
use Lingua::TokiPona::Numbers qw( num2tokipona );
for my $nanpa (reverse 0 .. 99) {
say 'poki ', num2tokipona($nanpa), ' pi telo nasa li lon sinpin.';
}
output:
poki mute pi telo nasa li lon sinpin.
poki mute pi telo nasa li lon sinpin.
poki mute pi telo nasa li lon sinpin.
...
poki ala pi telo nasa li lon sinpin.
DESCRIPTION
This module provides functions to convert numbers into words in Toki Pona, a constructed minimal language created by Sonja Elen Kisa and published in 2001.
FUNCTIONS
The following functions are provided but are not exported by default.
- num2tokipona EXPR
-
If EXPR looks like a number, the text describing the number is returned. Both integers and real numbers are supported, including negatives. Special values such as "inf" and "NaN" are also supported.
- num2tokipona_ordinal EXPR
-
If EXPR looks like an integer, the text describing the number in ordinal form is returned. The behavior when passing a non-integer value is undefined.
If EXPR is a value that does not look like a number or is not currently supported by this module, undef
is returned.
The :all
tag can be used to import all functions.
use Lingua::TokiPona::Numbers qw( :all );
SEE ALSO
http://en.tokipona.org/wiki/Numbers
AUTHOR
Nick Patch <n@atemoya.net>
ACKNOWLEDGEMENTS
Matthew Martin provided corrections to the Toki Pona number system
Sean M. Burke created the current interface to Lingua::EN::Numbers, which this module is based on.
COPYRIGHT AND LICENSE
Copyright 2010 Nick Patch
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.