Lingua::Klingon::Recode - Convert Klingon words between different encodings


Lingua-Klingon-Recode documentation  | view source Contained in the Lingua-Klingon-Recode distribution.

Index


NAME

Top

Lingua::Klingon::Recode - Convert Klingon words between different encodings

VERSION

Top

This document refers to version 1.02 of Lingua::Klingon::Recode, released on 2004-05-09.

SYNOPSIS

Top

  use Lingua::Klingon::Recode;
  @copy = Lingua::Klingon::Recode::recode('XIFAN HOL',    # from
                                          'tlhIngan Hol', # to
                                          @original);

or

  use Lingua::Klingon::Recode ':all';
  @copy = recode 'XIFAN HOL', 'tlhIngan Hol', @original;

or

  # demonstrate scalar version for a change
  use Lingua::Klingon::Recode qw( recode );
  $copy = recode 'XIFAN HOL', 'tlhIngan Hol', $original;




DESCRIPTION

Top

Overview

Lingua::Klingon::Recode is a module which allows you to convert Klingon text from one encoding to another.

For example, one frequently-used encoding is the so-called 'XIFAN HOL' encoding (after the encoded version of what is 'tlhIngan Hol' in the standard encoding).

All suported encodings can represent the same sounds, but they use different characters or sequences of characters to do so.

Most encodings have three allowable names (or aliasses): the transliteration of 'tlhIngan Hol', an abbreviated version with only 'tlhIngan', and an extended version "tlhIngan Hol Dajatlh'a'" (this extended version is mainly used to distinguish between related encodings that differ in how they represent the apostrophe).

The support encodings, with their recognised aliasses, are:

tlhIngan Hol, tlhIngan, tlhIngan Hol Dajatlh'a'

The standard encoding for Klingon; this is the usual transliteration.

tlhingan hol, tlhingan, tlhingan hol dajatlh'a'

This is the same as the standard encoding, except that all letters are lowercase. This has the grave disadvantage that 'q' and 'Q' are conflated, and that "ngh" can represent either "ng+H" or "n+gh" (it is interpreted as the former).

TLHINGAN HOL, TLHINGAN, TLHINGAN HOL DAJATLH'a'

This is the same as the standard encoding, except that all letters are uppercase. Again, 'q' and 'Q' cannot be distinguished in this encoding, and the sequence "NGH" is ambiguous.

XIFAN HOL, XIFAN, XIFAN HOL DAJAX'A'

This is the so-called "XIFAN HOL" encoding, used, for example, as the encoding of some fonts.

XIFANZ, XIFAN HOL DAJAXZAZ

This is the same encoding as the one above, but it uses Z for what is written ' (apostrophe) in the standard encoding, rather than the apostrophe. This encoding uses only the 26 letters of the uppercase Roman alphabet.

This encoding must be specified in its full form, or in the abbreviation 'XIFANZ'.

xifan hol, xifan, xifan hol dajax'a'

This is the "XIFAN HOL" encoding with all letters replaced by their lowercase form.

xifanz, xifan hol dajaxzaz

This is the "XIFAN HOL" encoding with all letters replaced by their lowercase form, and with 'z' rather than "'" for the apostrophe. This encoding uses only the 26 letters of the lowercase Roman alphabet.

uhmal gnj, uhmal, uhmal daiauzaz

This is an encoding formed by representing each Klingon letter in the standard transliteration with a lower-case Roman letter in alphabetical order according to the standard transliteration. It is also the encoding currently used by Lingua::Klingon::Collate. It can be represented as followed:

    tlhIngan Hol  a   b   ch  D   e   gh  H   I   j   l   m   n   ng
    uhmal gnj     a   b   c   d   e   f   g   h   i   j   k   l   m

    tlhIngan Hol  o   p   q   Q   r   S   t   tlh u   v   w   y   '
    uhmal gnj     n   o   p   q   r   s   t   u   v   w   x   y   z

UHMAL GNJ, UHMAL, UHMAL GNJ DAIAUZAZ

This is the uppercase version of the 'uhmal gnj' encoding.

Exports

Lingua::Klingon::Recode exports no functions by default, in order to avoid namespace pollution. However, all functions listed here can be imported explicitly by naming them, or they can be imported all together by using the tag ':all'.

recode

This is currently the only subroutine in this module.

It takes at least three parameters:

The strings are converted from the "from" encoding to the "to" encoding.

In list context, returns all the converted strings. In scalar context, returns the first converted string.

BUGS

Top

The 'tlhingan hol' and 'TLHINGAN HOL' encodings lose information; this is inherent in their definition. Do not use these encodings unless you really need to.

No bugs in the code itself are currently known.

Please report any bugs found through http://rt.cpan.org/ or by emailing the author.

SEE ALSO

Top

Lingua::Klingon::Collate

FEEDBACK

Top

If you use this module, I'd appreciate it if you drop me a line at the email address in AUTHOR, just so that I have an idea of how many people use this module at all. Also, if you have any comments, feel free to email me.

AUTHOR

Top

Philip Newton, <pne@cpan.org>

COPYRIGHT AND LICENSE

Top


Lingua-Klingon-Recode documentation  | view source Contained in the Lingua-Klingon-Recode distribution.