Skip to main content

mecab-ko-dic packaged for Python

Project description

mecab-ko-dic

This is a Korean dictionary for the MeCab tokenizer, packaged for use in Python with mecab-python3 or fugashi.

Should you use this?

We (at Luminoso) think this is probably a better way to find tokens in Korean words than just splitting the text on spaces would be. We also know that MeCab wasn't designed for Korean. But it gives us the kind of tokens we need better than other things we've tried.

One reason we're packaging this is to use it in wordfreq, which needs to have a reasonable set of consistent tokens so it can look up their frequencies, and already uses MeCab for Japanese.

If interoperability with things that already use MeCab is not your goal, you probably have better options for Korean NLP than this.

Credits

The dictionary data was created by Yongwoon Lee and Yungho Yu. We've included it as part of this package under the terms of the Apache License 2.0. The original dictionary can be found here.

The idea to package a MeCab dictionary as a Python repository, as well as the code structure for doing so, come from Paul McCann's ipadic package.

Usage

To install:

pip install mecab-ko-dic

To initialize with mecab-python3:

import MeCab
import mecab_ko_dic
tagger = MeCab.Tagger(mecab_ko_dic.MECAB_ARGS)
print(tagger.parse("안녕하세요세계."))

License

The data we use, and this code repository itself, are released under the Apache License 2.0. See the LICENSE.txt file included in this distribution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mecab-ko-dic-1.0.0.tar.gz (33.2 MB view details)

Uploaded Source

File details

Details for the file mecab-ko-dic-1.0.0.tar.gz.

File metadata

  • Download URL: mecab-ko-dic-1.0.0.tar.gz
  • Upload date:
  • Size: 33.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.3

File hashes

Hashes for mecab-ko-dic-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3ba22858736e02e8a0e92f2a7f099528c733ae47701b29d12c75e982a85d1f11
MD5 0a7cd0f4d032f18fb8d3f7c63e45c180
BLAKE2b-256 db86b88d823b0c912bb8e86584d697d51c866df567bd328f9196efab7835b8ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page