Skip to main content

KS X 1026 Python

Python implementation for KS X 1026-1.

KS X 1026-1

KS X 1026-1 is a Korean standard for Hangul processing guide for information interchange. More informations are available here.

Installation

KS X 1026 Python is available via PyPi

pip install ksx1026

or setup.py

python setup.py install

Normalizations

Hangul Decomposition

Returns a Johab Modern Hangul Syllable Block for the given Wanseong Modern Hangul Syllable Block

char S: Single character Hangul Syllable. If not, return input.

>>> from ksx1026.normalization import decomposeHangul
>>> c = "\uAC01"
>>> d = decomposeHangul(c)
>>> print(d.encode('raw_unicode_escape'))
b'\\u1100\\u1161\\u11a8'

Hangul Composition

Returns a Wanseong Modern Hangul Syllable Block for the given Johab Modern Hangul Syllable Block. Even when a portion of an Old Hangul Syllable Block is a Modern Hangul Syllable Block,unlike UAX #15, that portion is not transformed to a Wanseong Modern Hangul Syllable Block.

string source: unicode string.

>>> from ksx1026.normalization import composeHangul
>>> source = "\u1100\u1161\u11a8"
>>> d = composeHangul(source)
>>> print(d.encode('raw_unicode_escape'))
b'\\uac01'
>>> source = "\u1100\u1161\u11c3"
>>> d = composeHangul(source)
>>> print(d.encode('raw_unicode_escape'))
b'\\u1100\\u1161\\u11c3'

Hangul Recomposition

If one uses a UAX #15 algorithm instead of the above composeHangul function for normalization, an Old Hangul Syllable Block can be decomposed into a Wanseong Modern Hangul Syllable Block and Johab Hangul Letter(s). In such cases, after applying, one can use the following recomposition algorithm to restore a character string in Normalization Form NFC or NFKC to an L V T format.

string source: unicode string

>>> from ksx1026.normalization import recomposeHangul
>>> source = "\uac00\u11c3"
>>> d = recomposeHangul(source)
>>> print(d.encode('raw_unicode_escape'))
b'\\u1100\\u1161\\u11c3'

Normalization of Compatibility/Halfwidth Hangul Letters and Hangul-embedded symbols

Normalizing Compatibility/Halfwidth Hangul Letters and Hangul-embedded symbols (NormalizeJamoKDKC)

string source: unicode string

>>> from ksx1026.normalization import normalizeJamoKDKC
>>> source = "\u3200"
>>> d = normalizeJamoKDKC(source)
>>> print(d.encode('raw_unicode_escape'))
>>> b'(\\u1100\\u1160)

Metadata

Release files for ksx1026 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ksx1026 0.1.4
File Size Uploaded Provenance Actions
ksx1026-0.1.4.tar.gz 8.8 kB Without provenance Details for ksx1026-0.1.4.tar.gz

Release files / ksx1026-0.1.4.tar.gz

Download URL ksx1026-0.1.4.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
875449411847383634b99f62e3c4d19ae6b04b8f2019191b7e2576283a76168c
BLAKE2b-256 checksum
How to use checksums
2591617fa610d09650fa645265a1bda4f848582c7fd83952532cf85de9fcd8fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ksx1026 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page