README-Hangul

Lang::JA::Kana::Hangul - Japanese Kana to Korean Hangul Conversion

Documentation:

Overview

Lang::JA::Kana::Hangul provides comprehensive conversion from Japanese Kana (Hiragana and Katakana) to Korean Hangul script using multiple transliteration systems designed for different purposes and contexts.

Features

  • Multiple Conversion Systems: Four distinct systems tailored for different use cases

  • Comprehensive Character Support: Handles all standard kana, historical kana, and modern extensions

  • Sokuon (っ) Processing: Advanced handling of consonant doubling with system-specific rules

  • Korean Phonotactics: Proper Korean syllable structure with initial, medial, and final consonants

  • Unicode Compliance: Full Unicode Korean syllable block support (0xAC00-0xD7A3)

Installation

use Lang::JA::Kana::Hangul;

Basic Usage

use Lang::JA::Kana::Hangul;

# Basic conversion (Standard system - default)
say to-hangul("こんにけは");      # β†’ κ³€λ‹ˆμΉ˜ν•˜
say to-hangul("さくら");         # β†’ 사ꡬ라
say to-hangul("γ‚γ‚ŠγŒγ¨γ†");      # β†’ μ•„λ¦¬κ°€λ„μš°

# Academic system (linguistic precision)
say to-hangul("γŒγ£γ“γ†", :system<academic>);  # β†’ κΉμ½”μš°
say to-hangul("ばっば", :system<academic>);    # β†’ λΉ±λΉ 

# Phonetic system (preserves Japanese pronunciation)
say to-hangul("けゃけゅけょ", :system<phonetic>);  # β†’ μΉ˜μ•ΌμΉ˜μœ μΉ˜μš”
say to-hangul("きょう", :system<phonetic>);        # β†’ ν‚€μš”μš°

# Popular system (K-pop/media usage)
say to-hangul("けゅう", :system<popular>);     # β†’ μΆ”μš°
say to-hangul("γ˜γ‚ƒγ˜γ‚…γ˜γ‚‡", :system<popular>); # β†’ 쟈μ₯¬μ£ 

Conversion Systems

1. Standard System (Default)

The Standard system provides balanced phonetic conversion suitable for general use. It follows Korean phonological patterns while maintaining reasonable accuracy to Japanese pronunciation.

Characteristics:

  • Balanced approach between accuracy and Korean phonological naturalness

  • Standard Korean syllable structure (CV, CVC)

  • Regular consonant and vowel mappings

  • Appropriate for educational materials and general reference

Examples:

to-hangul("こんにけは");    # β†’ κ³€λ‹ˆμΉ˜ν•˜
to-hangul("しんぢん");     # β†’ μ‹ λΆ„
to-hangul("γŒγ£γ“γ†");     # β†’ 각고우

2. Academic System

The Academic system follows Korean linguistic conventions and academic transliteration standards. It includes special handling for consonant doubling and aspiration.

Characteristics:

  • Linguistic precision with Korean phonological rules

  • Advanced sokuon (っ) processing with consonant doubling

  • Tensed consonants (γ„², γ„Έ, γ…ƒ, γ…†, γ…‰) for doubled sounds

  • Aspirated consonants (γ…‹, γ…Œ, ㅍ, γ…Š) in specific contexts

  • Suitable for academic papers and linguistic research

Sokuon Rules:

  • Previous syllable: Gets tensed initial consonant + final consonant

  • Next syllable: Gets aspirated consonant (different) or tensed consonant (same)

Examples:

to-hangul("γŒγ£γ“γ†", :system<academic>);  # β†’ κΉμ½”μš° (tensed γ„² + aspirated γ…‹)
to-hangul("ばっば", :system<academic>);    # β†’ λΉ±λΉ  (tensed γ…ƒ on both syllables)
to-hangul("さっぽろ", :system<academic>);  # β†’ μ‚½ν¬λ‘œ

3. Phonetic System

The Phonetic system preserves Japanese pronunciation as closely as possible in Hangul, breaking down complex sounds into component parts.

Characteristics:

  • Decomposes palatalized sounds (けゃ β†’ μΉ˜μ•Ό, しゃ β†’ μ‹œμ•Ό)

  • Preserves Japanese phonological distinctions

  • Special mappings for certain sounds (っ β†’ μ―” when standalone)

  • Ideal for pronunciation guides and language learning

Examples:

to-hangul("けゃけゅけょ", :system<phonetic>);  # β†’ μΉ˜μ•ΌμΉ˜μœ μΉ˜μš”
to-hangul("しゃしゅしょ", :system<phonetic>);  # β†’ μ‹œμ•Όμ‹œμœ μ‹œμš”
to-hangul("けょっと", :system<phonetic>);      # β†’ μΉ˜μš”μ―”ν† 
to-hangul("きょう", :system<phonetic>);        # β†’ ν‚€μš”μš°

4. Popular System

The Popular system uses conventions common in Korean pop culture, media, and entertainment contexts.

Characteristics:

  • Optimized for K-pop, anime, and media contexts

  • Alternative mappings for certain sounds (けゅ β†’ μΆ”, γ˜γ‚ƒ β†’ 쟈)

  • Popular romanization patterns adapted to Hangul

  • Used in fan communities and entertainment media

Examples:

to-hangul("けゅう", :system<popular>);         # β†’ μΆ”μš°
to-hangul("γ˜γ‚ƒγ˜γ‚…γ˜γ‚‡", :system<popular>);   # β†’ 쟈μ₯¬μ£ 
to-hangul("γ™γš", :system<popular>);           # β†’ 수주

Character Support

Basic Kana

All standard Hiragana and Katakana characters are supported:

# Vowels
to-hangul("γ‚γ„γ†γˆγŠ");  # β†’ μ•„μ΄μš°μ—μ˜€
to-hangul("をむウエγ‚ͺ");  # β†’ μ•„μ΄μš°μ—μ˜€

# Consonant series (K, S, T, N, H, M, Y, R, W)
to-hangul("かきくけこ");  # β†’ κ°€κΈ°κ΅¬κ²Œκ³ 
to-hangul("さしすせそ");  # β†’ μ‚¬μ‹œμŠ€μ„Έμ†Œ

Voiced and Semi-voiced Sounds

# Voiced (濁音)
to-hangul("γŒγŽγγ’γ”");  # β†’ κ°€κΈ°κ΅¬κ²Œκ³ 
to-hangul("γ–γ˜γšγœγž");  # β†’ μžμ§€μ¦ˆμ œμ‘°
to-hangul("だげγ₯でど");  # β†’ λ‹€μ§€μ¦ˆλ°λ„
to-hangul("ばびぢべぼ");  # β†’ 바비뢀베보

# Semi-voiced (半濁音)
to-hangul("ぱぴぷぺぽ");  # β†’ νŒŒν”Όν‘ΈνŽ˜ν¬

Combination Sounds (ζ‹—ιŸ³)

# Y-combinations
to-hangul("きゃきゅきょ");  # β†’ 갸규ꡐ
to-hangul("しゃしゅしょ");  # β†’ μƒ€μŠˆμ‡Ό
to-hangul("けゃけゅけょ");  # β†’ μ°¨μΈ„μ΅Έ

# Voiced combinations
to-hangul("γŽγ‚ƒγŽγ‚…γŽγ‚‡");  # β†’ 갸규ꡐ
to-hangul("γ˜γ‚ƒγ˜γ‚…γ˜γ‚‡");  # β†’ 자주쑰
to-hangul("びゃびゅびょ");  # β†’ 뱌뷰례

Modern Extensions

# Foreign sound adaptations
to-hangul("ちぁちぃちぇちぉ");  # β†’ νŒŒν”ΌνŽ˜ν¬
to-hangul("てぃでぃ");         # β†’ ν‹°λ””
to-hangul("とぅどぅ");         # β†’ νˆ¬λ‘
to-hangul("うぃうぇうぉ");     # β†’ μœ„μ›¨μ›Œ
to-hangul("ゔぁゔぃゔぇゔぉ"); # β†’ 바비베보

Historical Kana

# Historical characters
to-hangul("ゐゑを");  # β†’ μœ„μ›¨μ˜€
to-hangul("γ‚”");      # β†’ λΆ€ (VU sound)

Sokuon (っ/ッ) Processing

The small tsu (っ/ッ) represents consonant doubling and is handled differently by each system:

Standard System

Adds final consonant to previous syllable:

to-hangul("γŒγ£γ“γ†");  # β†’ 각고우 (γ„± final + κ³ )
to-hangul("けょっと");  # β†’ 촛도 (γ…… final + 도)

Academic System

Advanced doubling with tensed and aspirated consonants:

to-hangul("γŒγ£γ“γ†", :system<academic>);  # β†’ κΉμ½”μš°
# が β†’ 깍 (tensed γ„² + final γ„±)
# こ β†’ μ½” (aspirated γ…‹)

to-hangul("ばっば", :system<academic>);    # β†’ λΉ±λΉ 
# ば β†’ λΉ± (tensed γ…ƒ + final γ…‚)  
# ば β†’ λΉ  (tensed γ…ƒ - same consonant)

Phonetic System

Processes after kana conversion, preserves pronunciation:

to-hangul("けょっと", :system<phonetic>);  # β†’ μΉ˜μš”μ―”ν† 
# っ treated as ぀ equivalent (μ―”) in context

Popular System

Simplified processing for media contexts:

to-hangul("けょっと", :system<popular>);   # β†’ μ΄ˆν† 

Korean Syllable Structure

The module uses proper Korean syllable structure with three components:

  1. Initial Consonant (μ΄ˆμ„±): 19 consonants including tensed and aspirated variants

  2. Medial Vowel (쀑성): 21 vowel combinations

  3. Final Consonant (μ’…μ„±): 28 possible endings including compound consonants

Consonant Mappings

Basic Consonants:

  • γ„± (g/k), γ„΄ (n), γ„· (d/t), γ„Ή (r/l), ㅁ (m), γ…‚ (b/p), γ…… (s), γ…‡ (ng/silent), γ…ˆ (j), γ…Š (ch), γ…‹ (k), γ…Œ (t), ㅍ (p), γ…Ž (h)

Tensed Consonants (Academic system):

  • γ„² (kk), γ„Έ (tt), γ…ƒ (pp), γ…† (ss), γ…‰ (jj)

Aspirated Consonants (Academic system):

  • γ…‹ (kh), γ…Œ (th), ㅍ (ph), γ…Š (chh)

Vowel Mappings

Simple Vowels:

  • ㅏ (a), γ…“ (eo), γ…— (o), γ…œ (u), γ…‘ (eu), γ…£ (i), ㅐ (ae), γ…” (e)

Complex Vowels:

  • γ…‘ (ya), γ…• (yeo), γ…› (yo), γ…  (yu), γ…’ (yae), γ…– (ye)

  • γ…˜ (wa), γ…™ (wae), γ…š (oe), ㅝ (wo), γ…ž (we), γ…Ÿ (wi), γ…’ (ui)

System Aliases

Multiple aliases are supported for convenience:

# Standard system
to-hangul("text", :system<standard>);
to-hangul("text", :system<default>);

# Academic system  
to-hangul("text", :system<academic>);
to-hangul("text", :system<scholarly>);

# Phonetic system
to-hangul("text", :system<phonetic>);
to-hangul("text", :system<literal>);

# Popular system
to-hangul("text", :system<popular>);
to-hangul("text", :system<media>);
to-hangul("text", :system<kpop>);

Advanced Features

Mixed Text Handling

Non-kana characters are passed through unchanged:

to-hangul("Hello こんにけは World");  # β†’ Hello κ³€λ‹ˆμΉ˜ν•˜ World
to-hangul("123 あいう ABC");         # β†’ 123 μ•„μ΄μš° ABC

Half-width Katakana Support

Half-width katakana is automatically converted to full-width before processing:

to-hangul("ο½ΆοΎ€ο½ΆοΎ…");  # β†’ κ°€λ‹€κ°€λ‚˜
to-hangul("アイウエ。"); # β†’ μ•„μ΄μš°μ—μ˜€

Long Vowel Processing

Long vowels are handled according to Korean phonological patterns:

to-hangul("とうきょう");  # β†’ λ„μš°κ΅μš°
to-hangul("γŠγŠγγ„");   # β†’ 였였기이
to-hangul("γƒΌ");         # β†’ (long vowel mark removed)

Technical Implementation

Unicode Ranges

  • Korean Syllables: U+AC00 to U+D7A3 (κ°€ to 힣)

  • Korean Jamo: U+1100 to U+11FF (individual consonants/vowels)

  • Japanese Hiragana: U+3040 to U+309F

  • Japanese Katakana: U+30A0 to U+30FF

Syllable Composition Algorithm

The module uses mathematical composition of Korean syllables:

syllable_code = 0xAC00 + (initial_index Γ— 21 Γ— 28) + (medial_index Γ— 28) + final_index

Performance Considerations

  • Efficient pattern matching with longest-first sorting

  • Unicode-compliant syllable decomposition and composition

  • Optimized regex patterns for sokuon processing

Linguistic Background

Korean Phonological Constraints

Korean has specific phonotactic rules that influence the conversion:

  1. Syllable Structure: Korean prefers (C)V(C) structure

  2. Consonant Clusters: Limited consonant clusters in final position

  3. Vowel Harmony: Considered in academic system

  4. Tensing Rules: Applied in academic system for accuracy

Japanese-Korean Phonological Mapping

Historical linguistic relationships inform the conversion patterns:

  1. Shared Chinese Character Readings: Common Sino-Korean/Sino-Japanese patterns

  2. Phonological Correspondences: Systematic sound relationships

  3. Modern Adaptations: Contemporary borrowing patterns

Use Cases

Educational Applications

  • Japanese language learning materials for Korean speakers

  • Comparative linguistics studies

  • Pronunciation guides and dictionaries

Media and Entertainment

  • K-pop artist name romanization

  • Anime/manga title adaptation

  • Fan community translations

Academic Research

  • Linguistic analysis and comparison

  • Historical phonology studies

  • Cross-cultural communication research

Technical Applications

  • Search and indexing systems

  • Database normalization

  • Cross-script information retrieval

Limitations

  1. Context Sensitivity: Some conversions may require contextual knowledge

  2. Semantic Ambiguity: Pure phonetic conversion without semantic consideration

  3. Dialectal Variations: Based on standard Japanese pronunciation

  4. Kanji Handling: Does not process Chinese characters (Kanji)

Error Handling

The module gracefully handles various input conditions:

  • Invalid Unicode characters are passed through unchanged

  • Unknown kana characters are preserved

  • Empty strings return empty results

  • Mixed scripts are processed selectively

Contributing

Contributions are welcome. Please visit the project repository at:https://github.com/slavenskoj/raku-lang-ja-kana

We apologize for any errors and welcome suggestions for improvements.

References

Academic Sources

  • Korean Language Society (ꡭ립ꡭ어원) romanization guidelines

  • Japanese-Korean linguistic correspondence studies

  • Unicode Consortium Korean block specifications

Standards

  • ISO 11941 (Korean script romanization)

  • Unicode Standard Korean syllable block

  • Japanese Industrial Standards (JIS) kana specifications

License

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

Author

Danslav Slavenskoj

For more information about the complete Lang::JA::Kana module suite, see the main README.md file.

Lang::JA::Kana v1.2.1

Japanese Hiragana and Katakana conversion utilities

Authors

  • Danslav Slavenskoj

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Lang::JA::Kana
  • Lang::JA::Kana::Hangul
  • Lang::JA::Kana::Kuriru-moji
  • Lang::JA::Kana::Romaji

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.