Skip to main content

Python wrapper for the MeCab-ko morphological analyzer for Korean

Project description

This is a Python wrapper for the MeCab-ko morphological analyzer for Korean text. It works with Python 3.6 and greater.

There are several implementations of python binding or wrapper for MeCab-ko, but they are generally not well maintained.
I made it to stand on the shoulders of giants(well-maintained open-source projects like MeCab, mecab-ko and mecab-python3) with minimum modifications.
I initially named it mecab-ko-python3 because the package name referenced for development was mecab-python3,
it may seem a little arrogant, but to reduce confusion in the PyPI, the name was changed to 'mecab-ko'.
(The repository is named 'pymecab-ko' to distinguish it from original mecab-ko)

Note: If using MacOS Big Sur, you'll need to upgrade pip to version 20.3 or higher to use wheels due to a pip issue.

issue를 영어로 작성할 필요는 없습니다.

Note that Windows wheels require a Microsoft Visual C++ Redistributable, so be sure to install that.

Basic usage

>>> import mecab_ko as MeCab
>>> tagger = MeCab.Tagger("-Owakati")
>>> tagger.parse("아버지가방에들어가신다").split()
['아버지', '가', '방', '에', '들어가', '신다']

>>> tagger = MeCab.Tagger()
>>> print(tagger.parse("아버지가방에들어가신다"))
아버지  NNG,*,F,아버지,*,*,*,*
      JKS,*,F,,*,*,*,*
      NNG,*,T,,*,*,*,*
      JKB,*,F,,*,*,*,*
들어가  VV,*,F,들어가,*,*,*,*
신다    EP+EC,*,F,신다,Inflect,EP,EC,/EP/*+ㄴ다/EC/*
EOS

The API for pymecab-ko closely follows the API for MeCab itself, even when this makes it not very “Pythonic.” Please consult the official MeCab documentation for more information.

Installation

Binary wheels are available for MacOS X, Linux, and Windows (64bit) are installed by default when you use pip:

pip install mecab-ko

These wheels include a copy of the MeCab-ko library and a dictionary. There is a unique dictionary available for MeCab-ko. mecab-ko-dic is automatically installed when installing pymacab-ko.

  • mecab-ko-dic: The pre-built mecab-ko-dic 2.1.1-20180720 based on ipadic-py.
  • mecab-ko-dic: The original source-code of mecab-ko-dic to build dictionary for mecab-ko.

To build from source using pip,

pip install --no-binary :all: mecab-ko

Common Issues

If you get a RuntimeError when you try to run MeCab, here are some things to check:

Windows Redistributable

You have to install this to use this package on Windows.

Specifying a mecabrc

If you get this error:

error message: [ifs] no such file or directory: /usr/local/etc/mecabrc

You need to specify a mecabrc file. It's OK to specify an empty file, it just has to exist. You can specify a mecabrc with -r. This may be necessary on Debian or Ubuntu, where the mecabrc is in /etc/mecabrc.

You can specify an empty mecabrc like this:

tagger = MeCab.Tagger('-r/dev/null -d/home/hoge/mydic')

Using Unsupported Output Modes like -Ochasen

Chasen output is not a built-in feature of MeCab, you must specify it in your dicrc or mecabrc. Notably, mecab-ko-dic does not include Chasen output format. Please see the MeCab documentation.

Alternatives

Licensing

Like MeCab and mecab-python3, pymecab-ko is copyrighted free software by Taku Kudo taku@chasen.org and Nippon Telegraph and Telephone Corporation, and is distributed under a 3-clause BSD license (see the file BSD). Alternatively, it may be redistributed under the terms of the GNU General Public License, version 2 (see the file GPL) or the GNU Lesser General Public License, version 2.1 (see the file LGPL).

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-1.0.0a1.tar.gz (79.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mecab_ko-1.0.0a1-cp310-cp310-win_amd64.whl (500.3 kB view details)

Uploaded CPython 3.10Windows x86-64

mecab_ko-1.0.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (582.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mecab_ko-1.0.0a1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (561.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

mecab_ko-1.0.0a1-cp310-cp310-macosx_10_15_x86_64.whl (283.7 kB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

mecab_ko-1.0.0a1-cp39-cp39-win_amd64.whl (500.4 kB view details)

Uploaded CPython 3.9Windows x86-64

mecab_ko-1.0.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (582.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

mecab_ko-1.0.0a1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (560.9 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

mecab_ko-1.0.0a1-cp39-cp39-macosx_10_15_x86_64.whl (283.7 kB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

mecab_ko-1.0.0a1-cp38-cp38-win_amd64.whl (500.6 kB view details)

Uploaded CPython 3.8Windows x86-64

mecab_ko-1.0.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (578.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

mecab_ko-1.0.0a1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (556.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

mecab_ko-1.0.0a1-cp38-cp38-macosx_10_14_x86_64.whl (283.6 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

mecab_ko-1.0.0a1-cp37-cp37m-win_amd64.whl (500.5 kB view details)

Uploaded CPython 3.7mWindows x86-64

mecab_ko-1.0.0a1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (576.0 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

mecab_ko-1.0.0a1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (552.8 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

mecab_ko-1.0.0a1-cp37-cp37m-macosx_10_14_x86_64.whl (283.6 kB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

mecab_ko-1.0.0a1-cp36-cp36m-win_amd64.whl (510.6 kB view details)

Uploaded CPython 3.6mWindows x86-64

mecab_ko-1.0.0a1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (575.8 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

mecab_ko-1.0.0a1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (552.6 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ ARM64

mecab_ko-1.0.0a1-cp36-cp36m-macosx_10_14_x86_64.whl (283.6 kB view details)

Uploaded CPython 3.6mmacOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: mecab-ko-1.0.0a1.tar.gz
  • Upload date:
  • Size: 79.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for mecab-ko-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 a0f15205b2b442377c9c481bd31f3ccd7d2c96e4b8db70c519d8ccb096a665ba
MD5 9c72ce87f45eaf76e31aa37644f9ce8c
BLAKE2b-256 26b9228056b030bf49f1879e3795efbfee3756ca5efea358acd3a702e0622e44

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mecab_ko-1.0.0a1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 500.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for mecab_ko-1.0.0a1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 173dcb867df631a6136d918eeb4313e7e6daa0527a80103edb0ac4fed23a3f77
MD5 16bc98d9bee25bfafda20a985831a171
BLAKE2b-256 b5796d43cd189448b2d89a2a23896e0997579d260269ebe14130500f1edf880a

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6a6e90b86de50651cab5891b785e7e38ec78cf00ca3e5714fdc22427e0fe4b43
MD5 6dde3a49fc6018d1861d0f71ff31eb3a
BLAKE2b-256 9558ba65da0e95d008a73f4187df1152925d6fdfe07227d572331602cc11dafd

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dc8d01059aa8b57d4f48043de720e17c265d86762b25f57d539697e0c55b31fb
MD5 7c1aedfaf27dbc8b547dd4f2e1cb6e99
BLAKE2b-256 f39e6a3c808cb1a87a8e6fa567e1df4f3dbaa5d6ccec002f74f0710b8fc24d98

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b09a8b78f71d8997b8f1592b288f7c949bcf9169adc9a4bd21bdd6af009ef754
MD5 a77add2c4d64d35fe1102adb308c9e42
BLAKE2b-256 6144dc0830a8e4ca86ea3fab4e71f08e3ecb9d5eee60ec1be8bc46b079d66b0e

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: mecab_ko-1.0.0a1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 500.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for mecab_ko-1.0.0a1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fda53f06331c31396d9710624dcb1a16e7d8858052ba46bc5bf99eefb22af952
MD5 db0eaaff0a478d45d3399f5c2026400f
BLAKE2b-256 79cd51aa39eaeb56c5de95ef121643fdf96e49547e195454d0794b0fce0d3c8a

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5e1e9c6189cd9a634c1fa875f4869dbaca13974494fce997f98ca82d14d4dbfc
MD5 84680302e636c9c4d9f1cd3b3508a5a7
BLAKE2b-256 ac23d5c7e767a73f74ba406d6aad1293e1c1ca767722c569b8768d450dcb176c

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4da74125ad474c10d3b66ee7b5c0258220e6b1d6ae047e7a4c9da1178b744118
MD5 40f4f8a7948ec384cc841245d124ba80
BLAKE2b-256 f82ada86167b9f3bcc69b86f0225a37c1692a69bf39f2ad83a207b76fb68b84f

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 757a7a83634be01cd2a6101cf8fb38b3a3eeb98c2b5753fbb52172d342b5329b
MD5 ef79c458c90c05942c7e900970f86f42
BLAKE2b-256 5b57ba6668580ad68982b627ffb5f93fae1d727936e5e6cbb948182d91ec0404

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: mecab_ko-1.0.0a1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 500.6 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for mecab_ko-1.0.0a1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d980fcbe8c344c13407e0b93409f08bc85fc878e183c6462bc0511b53f59a90c
MD5 345afa80a7f78fd838b95f693b04e823
BLAKE2b-256 d5a359085b0e81636c27faf42c9eec8a9fecad3ab23128e095ab68503ff287b8

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 319a9a8de55df499d6ff37a8a75e1e41e7ab689cc24363a9881cc01e01530de1
MD5 510ed8f94e8685863c6903e29076d40a
BLAKE2b-256 53b2ec99c2c079667b88790e627617d4320b63ad5df213dda77806dfe37b2cd2

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2c267b8d16ef5721c4077e717487a84931e1d920c8b0fa50f701282e73f3d2fb
MD5 d4515390209dd007926df3ee7ffd27ce
BLAKE2b-256 a4d29af7ae444611b71053dfb259dd605f0fcd3be90b29b1189d352d6d3fa036

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 85fb5a3924abcf90400fbd49d88e11bb99cea40735bbb54b762533c520025c41
MD5 3dfecfcea4b28d9e416c568a7fe0b277
BLAKE2b-256 d2eab5bf6415e7e5227aca2e8be923052f4bec69380c785a1f38613d67d20373

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: mecab_ko-1.0.0a1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 500.5 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for mecab_ko-1.0.0a1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a3c935039f1a0c8ae3079ef4057de8a193d349b330bd014d8ac989948100fa27
MD5 071c0c25d10d4292dc970c5e1364c86a
BLAKE2b-256 9073e74b953488949925cb092aee73d416172dea96c23c55788335a925102bc6

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6ccd06c6834e599af4cf97f0f47cf7174c76aac9eaea773f5690b352db8ac5fb
MD5 7fecbee580e149206872133b10f62efb
BLAKE2b-256 1ec186bd509acd6e6ca11090749c626fb712083404f1f5548771882fd3515e34

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dc4c9a0c3cb820f43f85c001d4d6e67683f8cb5d432a70be623317f0abec84eb
MD5 fd8ae1f112c97a1570688d97af6f2467
BLAKE2b-256 88fb6e9bbab6364288babf84b49dfe632d46b7eeaa59cd727348873931f98970

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 bc7eb2181ae8807dbabd6db51fbbf2eb72f2d18452193af07996738ef26b34df
MD5 a0ce3764baeaa4883826e966e47c24cf
BLAKE2b-256 8d703cb6601088a681271c9f9a67f7062f123673507d8f14452e03a5351a5e17

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: mecab_ko-1.0.0a1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 510.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.8

File hashes

Hashes for mecab_ko-1.0.0a1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d3a74b1d44dd8b51be7e046f17961cbf111a1d1d2fa8b79627b424a67c94aca8
MD5 1b664a18f23ae7809663d515ac950d52
BLAKE2b-256 fef6a5c4910ed8c867fc0050e3512150aa3f58689283db7202653b1ae865c80c

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57e32d711128eef7d89877bc5abc45cab352243da7c10f757b52391f5caa143d
MD5 871e9505c04e0fdb07be69cae92c4981
BLAKE2b-256 7c677e21612fba0b59f291a19c928fb5a3b85b77bcb3306d2ea141ce7fb43b47

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mecab_ko-1.0.0a1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e26d4e0cdc6d52ebedc70ba859ca2205c2cff8530cdc18873248de15775828ee
MD5 e146fc50c9d7e956c31e8a5b609d5b2b
BLAKE2b-256 cf59a42bfdd546a4c862acd8214e5426f02118b550dcb87895c5df7c614f7957

See more details on using hashes here.

File details

Details for the file mecab_ko-1.0.0a1-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: mecab_ko-1.0.0a1-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 283.6 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15

File hashes

Hashes for mecab_ko-1.0.0a1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 01cc987f1fdc097e908c2c419cf1ba3d80ee8bc39a5ec4af6409a7d5e4a32890
MD5 8bd58e9ea871b8e81ae07b701af93ffb
BLAKE2b-256 a6df0a580243db6a5253f1abaa5fb9f2857618a1f3aa420ccc31746055410945

See more details on using hashes here.

Supported by

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