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

NAME

Lingua::KO::Hangul::JamoCompatMapping - provide a function that maps Hangul Jamo into Hangul Compatibility code

VERSION

version 0.004

SYNOPSIS

    use Lingua::KO::Hangul::JamoCompatMapping qw/jamo_to_compat/;

    # HANGUL CHOSEONG KIYEOK (\x{1100}) => HANGUL LETTER KIYEOK (\x{3131})
    $letter = jamo_to_compat("\x{1100}");
    # HANGUL JONGSEONG KIYEOK (\x{11A8}) => HANGUL LETTER KIYEOK (\x{3131})
    $letter = jamo_to_compat("\x{11A8}");

DESCRIPTION

Function jamo_to_compat() maps "Hangul Jamo" to "Hangul Compatibility Jamo" and returns compatibility jamo code.

It receives as an argument a codepoint of a single Hangul Jamo, and returns the codepoint of a Hangul Compatibility Jamo that responds to the argument. It returns undefined value in case there is not the mapping for given argument.

Up to now, only consonants and vowels that are used in the present-day are mapped.

  CHOSEONG  (the initial sound)   \x{1100} .. \x{1112}
  JUNGSEONG (the medial sound)    \x{1161} .. \x{1175}
  JONGSEONG (the final sound)     \x{11A8} .. \x{11C2}

Note that two consonants, one in CHOSEONG and the other in JONGSEONG, may be mapped into the same codepoint. For example, both \x{1100}(CHOSEONG KIYEOK) and \x{11A8} (JONGSEONG KIYEOK) are mapped to the same codepoint \x{3131}(LETTER KIYEOK).

This module can be used to match a sequence of Hangul letters over a Korean word. For example, decomposeSyllable() from Lingua::KO::Hangul::Util decomposes a Hangul syllable to a sequence of conjoining letters. These letters are in the range of Hangul Jamo in Unicode. However, when another sequence of letters are provided via standard input or network(CGI, etc), they might be in the range of Hangul Compatibility Jamo. In this case, you need to convert the former sequence into the sequence of Compatibility Jamo to examine whether two sequence match or not.

SEE ALSO

Lingua::KO::Hangul::Util

AUTHOR

Geunyoung Park <gypark@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Geunyoung Park.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.