Registry / ai-ml / g2pkk
library0.1.2pypypiunverified

g2pkk is a Grapheme-to-Phoneme (G2P) conversion module specifically designed for Korean text, aiming for cross-platform compatibility. It is currently at version 0.1.2 and appears to have an active, though not rapid, release cadence given its early development stage.

pip install g2pkk
INSTALL
IMPORT
SIG · G2PKK
G
g2pkk
ai-mlpythonv0.1.2
Install
3.3s avg
Import
Disk
35MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 35.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.3s · import 0.000s · 37MB
35MB installed
● package 35MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

G2pkk
from g2pkk import G2pkk

This quickstart demonstrates how to initialize the G2pkk converter and use it to transform Korean text into its romanized phonetic representation. It includes a crucial step to ensure the NLTK 'punkt' resource is downloaded, which is a common prerequisite for many NLP libraries.

import nltk from g2pkk import G2pkk # Important: Download NLTK 'punkt' resource if not already done try: nltk.data.find('tokenizers/punkt') except nltk.downloader.DownloadError: print("Downloading NLTK 'punkt' resource...") nltk.download('punkt') # Initialize the G2P converter g2p = G2pkk() # Convert Korean text to its phoneme representation text = "안녕하세요 g2p 입니다. 반갑습니다. 123." result = g2p(text) print(f"Original: {text}") print(f"Phonetic: {result}") # Example with specific romanization text_roman = g2p("한국어") print(f"'한국어' phonetic: {text_roman}")
Debug
Known issues
gotchaThe `nltk` library, a dependency of g2pkk, requires the 'punkt' tokenizer resource to be downloaded separately. Failure to do so will result in a `LookupError`.
fix
Run `import nltk; nltk.download('punkt')` once before using g2pkk. It's good practice to include this check at the start of your application.
affects: All versions
gotchag2pkk is in early development (version 0.1.x), which means its API might undergo non-backward-compatible changes in future minor or patch releases as it approaches a stable 1.0 version.
fix
Pin your `g2pkk` dependency to exact versions (e.g., `g2pkk==0.1.2`) in your `requirements.txt` to prevent unexpected breaking changes with new releases. Review release notes for any new versions carefully.
affects: All versions prior to 1.0.0
gotchaInput text must be primarily Korean. While it handles numbers and some English, its core functionality and accuracy are designed for Korean grapheme-to-phoneme conversion.
fix
Ensure that the majority of the input text is Korean for optimal results. Mixed language input might produce less accurate or less natural-sounding romanizations for non-Korean parts.
affects: All versions
Upgrade
Version history
0.1.2latest on PyPI · released Sep 5, 2022
Audit
Dependencies
jamotoolsrequiredRequired for Korean character processing.
jamorequiredRequired for Korean character processing.
nltkrequiredRequired for natural language processing tasks, specifically the 'punkt' tokenizer.
pykospacingrequiredUsed for Korean spacing correction, improving G2P accuracy.
korean-romanizerrequiredUsed for romanization of Korean text.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
g2pkk — pip install g2pkk · libregistry