Hangul Romanize

0.1.0 · active · verified Thu Apr 16

hangul-romanize is a Python library for romanizing Hangul strings, specifically adhering to the academic notation rules (국립국어원 학술 표기법) of the National Institute of Korean Language. As of version 0.1.0, it provides tools for converting Korean text into the Latin alphabet based on these scholarly guidelines.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the `Transliter` class and the `academic` rule set, then use them to romanize Korean Hangul strings. It prints the original and romanized text.

from hangul_romanize import Transliter
from hangul_romanize.rule import academic

# Initialize the transliterator with the academic rule set
transliter = Transliter(academic)

# Romanize a Hangul string
hangul_text = u'안녕하세요'
romanized_text = transliter.translit(hangul_text)
print(f"Original: {hangul_text}, Romanized: {romanized_text}")

# Example with another string
hangul_text_2 = u'한글 로마자 변환'
romanized_text_2 = transliter.translit(hangul_text_2)
print(f"Original: {hangul_text_2}, Romanized: {romanized_text_2}")

view raw JSON →