README-Hangul
Lang::JA::Kana::Hangul - Japanese Kana to Korean Hangul Conversion
Documentation:
Romaji: README-Romaji.md
Cyrillic: English β’ Π ΡΡΡΠΊΠΈΠΉ
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 contextPopular System
Simplified processing for media contexts:
to-hangul("γ‘γγ£γ¨", :system<popular>); # β μ΄ν Korean Syllable Structure
The module uses proper Korean syllable structure with three components:
Initial Consonant (μ΄μ±): 19 consonants including tensed and aspirated variants
Medial Vowel (μ€μ±): 21 vowel combinations
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 μμ΄μ° ABCHalf-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_indexPerformance 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:
Syllable Structure: Korean prefers (C)V(C) structure
Consonant Clusters: Limited consonant clusters in final position
Vowel Harmony: Considered in academic system
Tensing Rules: Applied in academic system for accuracy
Japanese-Korean Phonological Mapping
Historical linguistic relationships inform the conversion patterns:
Shared Chinese Character Readings: Common Sino-Korean/Sino-Japanese patterns
Phonological Correspondences: Systematic sound relationships
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
Context Sensitivity: Some conversions may require contextual knowledge
Semantic Ambiguity: Pure phonetic conversion without semantic consideration
Dialectal Variations: Based on standard Japanese pronunciation
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.