Encode::Korean - Perl extension for Encoding of Korean: Transliterator Generator

SYNOPSIS

  use Encode::Korean::TransliteratorGenerator;

  my $coder = Encode::Korean::TransliteratorGenerator->new();

  $coder->consonants(@CONSONANTS);
  $coder->vowels(@VOWELS);
  $coder->sep($SEP);
  $coder->make();

  while($utf_input = <>) {
	print $coder->encode(decode 'utf8', $utf_input);
  }

DESCRIPTION

This module provide a generic Korean transliterator class. You can define your own rules and create your own transliterator object.

The transliteration based encoding modules uses this class. See Encode::Korean.

How to define a custom transliteration set

@CONSONANT  : array of 19 consonant letters
@VOWEL      : array of 21 vowel letters
$EL         : jongseong l
$ELL        : consecutive l's 
$NAUGHT     : soundless choseong ieung
$SEP        : syllable separator
$MODE       : CamelCase, greedy_sep, smart_sep 

eg. South Korean Standard

@CONSONANT = qw(g kk n d tt r m b pp s ss ng j jj ch k t p h);
@VOWEL = qw(a ae ya yae eo e yeo ye o wa wae oe yo u wo we wi yu eu ui i);
$EL = "l";
$ELL = "ll";
$NAUGHT = "'";
$SEP = "-";

TRANSLITERATION MODES

Transliteration modes for ambiguous syllable boundary resolution

1. Use CamelCase

Makes syllables capitalized. Ignores $NAUGHT and $SEP.

eg. 하나 -> HaNa, 한아 -> HanA

2. Greedy Separator

Insert $SEP between syllables.

eg. 하나 -> ha.na, 한아 -> han'a, where $SEP = '.'; $NAUGHT = "'";
eg. 하나 -> ha.na, 한아 -> han.a, where $SEP = '.'; $NAUGHT = undef;

3. Smart Separator

Insert $SEP when syllable boundaries are ambiguous in transliteration.

If $NAUGHT is defined and is not null:

  insert $NAUGHT for the soundless head (choseong ieung)
  insert $SEP between consonant groups.

  eg. 하나 -> hana, 한아 -> han'a
  eg. 앉� -> anc.ca, 안짜 -> an.cca

else :

  insert $SEP for the soundless head and between consonant groups.

  eg. 하나 -> hana,    한아 -> han.a
  eg. 앉� -> anc.ca,  안짜 -> an.cca 
      앉하 -> anc.ha,  안차 -> an.cha
  eg. 갂아 -> kakk.a,  �가 -> kak.ka, 가까 -> kakka
      �까 -> kak.kka, 갂가 -> kakk.ka
      갂까 -> kakk.kka

SEE ALSO

AUTHOR

You Hyun Jo, <youhyunjo at gmail dot com>

COPYRIGHT AND LICENSE

Copyright (C) 2007 by You Hyun Jo

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 619:

Unknown directive: =utf8

Around line 677:

Non-ASCII character seen before =encoding in '하나'. Assuming CP1252