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

NAME

Lingua::TLH::Numbers - Convert numbers into Klingon words

VERSION

This document describes Lingua::TLH::Numbers version 0.01.

SYNOPSIS

    use 5.010;
    use Lingua::TLH::Numbers qw( num2tlh );

    for my $mI (reverse 0 .. 99) {
        say ucfirst num2tlh($mI), " bal vo' HIq Daq reD.";
    }

output:

    HutmaH Hut bal vo' HIq Daq reD.
    HutmaH chorgh bal vo' HIq Daq reD.
    HutmaH Soch bal vo' HIq Daq reD.
      ...
    pagh bal vo' HIq Daq reD.

DESCRIPTION

This module provides functions to convert numbers into words in Klingon, a constructed fictional language created by Mark Okrand and introduced in 1984.

FUNCTIONS

The following functions are provided but are not exported by default.

num2tlh EXPR

If EXPR looks like a number, the text describing the number is returned. Both integers and real numbers are supported, although negatives are not currently supported.

num2tlh_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::TLH::Numbers qw( :all );

TODO

  • support negatives, inf, and NaN

  • support exponential notation

  • option for the older ternary number system

  • option for using "SanID" instead of "SaD" for "thousand"

SEE ALSO

Lingua::Conlang::Numbers, http://klingonska.org/ref/num.html, http://mughom.wikia.com/wiki/QaH:A_Guide_to_Klingon/others

AUTHOR

Nick Patch <patch@cpan.org>

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.