Lingua::Klingon::Recode - Convert Klingon words between different encodings
This document refers to version 1.02 of Lingua::Klingon::Recode, released on 2004-05-09.
use Lingua::Klingon::Recode; @copy = Lingua::Klingon::Recode::recode('XIFAN HOL', # from 'tlhIngan Hol', # to @original);
use Lingua::Klingon::Recode ':all'; @copy = recode 'XIFAN HOL', 'tlhIngan Hol', @original;
# demonstrate scalar version for a change use Lingua::Klingon::Recode qw( recode ); $copy = recode 'XIFAN HOL', 'tlhIngan Hol', $original;
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:
The standard encoding for Klingon; this is the usual transliteration.
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).
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.
This is the so-called "XIFAN HOL" encoding, used, for example, as the encoding of some fonts.
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'.
This is the "XIFAN HOL" encoding with all letters replaced by their lowercase form.
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.
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
This is the uppercase version of the 'uhmal gnj' encoding.
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'.
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.
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.
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.
Philip Newton, <email@example.com>
Copyright (C) 2003, 2004 by Philip Newton. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.