A modern Python library for Korean josa processing with dictionary support and framework integrations.
Project description
korean_glue
A modern Python library for Korean josa processing combining rule-based and dictionary-based approaches. Django template tags and Jinja2 filters are included for easy web framework integration.
Installation
pip install korean_glue
Framework integrations rely on Django and Jinja2.
Usage
Basic API
from korean_glue import attach, get_josa
print(get_josa("사과", "은/는")) # "는"
print(attach("사과", "은/는")) # "사과는"
Custom Exception Rules
from korean_glue import add_exception_rule, remove_exception_rule, attach
add_exception_rule("사과", "은/는", "당")
print(attach("사과", "은/는")) # "사과당"
remove_exception_rule("사과", "은/는")
Command Line
Install the package and run the kglue command:
kglue '철수(은/는)'
kglue 'K(이/가)'
kglue '3(을/를)'
Framework Integrations
Django
{{ variable|josa:"을/를" }}
Jinja2
from korean_glue.integrations import jinja_filters
from jinja2 import Environment
env = Environment()
jinja_filters.register(env)
result = env.from_string("{{ word|josa('으로/로') }}").render(word="서울")
Running Tests
After setting up a development environment (see CONTRIBUTING.md), run:
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file korean_glue-0.1.1-py3-none-any.whl.
File metadata
- Download URL: korean_glue-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cd0b72f2a0c0ab95f4b1c22c8b969857426f00d910283b8b8656bb9a3da29f7
|
|
| MD5 |
07bae635ee2167b007aeaf455567b08f
|
|
| BLAKE2b-256 |
76a60c1929484dc3673ec0b72dba1ef270514a8c06df6ee9d621b518efac1399
|