Skip to main content

Lexikanon

pypi-image license-image

Korean and English tokenizers, text normalizers, and stopword lists. Lexikanon is a plain Python library; it also ships HyFI 2.0 config groups, so the same tokenizers can be selected and run from HyFI workflows.

Lexikanon 1.0 drops the HyFI 1.x API. Pin lexikanon<1 to keep it.

Install

uv add lexikanon          # or: pip install lexikanon
pip install 'lexikanon[datasets]'     # tokenize_dataset / extract_tokens on datasets.Dataset
pip install 'lexikanon[similarity]'   # find_similar_docs_by_clustering

Python 3.11 or newer. Korean morphological analysis uses MeCab through eKoNLPy (fugashi and mecab-ko-dic wheels). On Python 3.15, fugashi builds from source and needs the MeCab library (apt-get install libmecab-dev or brew install mecab).

Use it as a library

from lexikanon.normalizers import Normalizer
from lexikanon.tokenizers import MecabTokenizer

tokenizer = MecabTokenizer(noun_postags=["NNG", "NNP"])
tokenizer("금통위는 물가안정과 금리정책을 밝혔다.")
# ['금통위/NNG', '는/JX', '물가/NNG', '안정/NNG', '과/JC', ...]
tokenizer.nouns("금통위는 물가안정과 금리정책을 밝혔다.")

Normalizer(hanja2hangle=True)("今年에도 持續하고 있다")
# '금년에도 지속하고 있다'

Importing lexikanon never imports HyFI.

Use it from HyFI

Installing lexikanon registers its config groups through the hyfi.plugins entry point:

group options
tokenizer default, simple, mecab, nltk, nltk_universal
normalizer default, formal_ko, informal_ko, formal_en, formal_en_parantheses
stopwords default
workflow lexikanon_tokenize_text, lexikanon_tokenize_dataset, lexikanon_find_similar_docs
hyfi plugins
hyfi run workflow=lexikanon_tokenize_text tokenizer=mecab
import hyfi

tokenizer = hyfi.instantiate(hyfi.compose_group("tokenizer", "mecab"))

See Usage for workflow steps and presets.

Citation

@software{lee_2023_lexikanon,
  author       = {Young Joon Lee},
  title        = {Lexikanon: A HyFI-based library for Tokenizers},
  year         = 2023,
  publisher    = {GitHub},
  url          = {https://github.com/entelecheia/lexikanon}
}

License

MIT

Metadata

Release files for lexikanon 1.0.2

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

Source distribution (sdist)

Source distribution for lexikanon 1.0.2
File Size Uploaded Provenance
lexikanon-1.0.2.tar.gz 1.2 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lexikanon 1.0.2
File Interpreter ABI Platform
lexikanon-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / lexikanon-1.0.2.tar.gz

Download URL lexikanon-1.0.2.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
9b681b31d632e75f72c12ec778bb344b3a0c14bfde8d1585c2323c1e4ac034ac
BLAKE2b-256 checksum
How to use checksums
87086cbd0c400511ab1cec1029c3d5fdabf674f857c18e63b58efbd75ba1c210
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / lexikanon-1.0.2-py3-none-any.whl

Download URL lexikanon-1.0.2-py3-none-any.whl
Size 854.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
487311ba132eff84e6d747c7e79075261a0904f97670e71e2abbecc8071056cc
BLAKE2b-256 checksum
How to use checksums
0735e14a23ea0d8a6e459d560e9d1acd7e2495d33d78fe9faa73e3f0f6dc3acd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for lexikanon 1.0.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lexikanon-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

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