Skip to main content

A python binding for mecab-ko

Project description

python-mecab-ko

A python binding for mecab-ko

Installation

Using pip:

$ pip install python-mecab-ko

This library currently provides binary wheels on Linux and macOS platforms. If you are using other platforms, you need the following prerequisites to build from source:

  • C++14 compatible compiler
  • Python header files
  • mecab-ko
    • This repository provides a convenience script at scripts/install_mecab_ko.py to install mecab-ko

Usage

import mecab
mecab = mecab.MeCab()

mecab.morphs('영등포구청역에 있는 맛집 좀 알려주세요.')
# ['영등포구청역', '에', '있', '는', '맛집', '좀', '알려', '주', '세요', '.']

mecab.nouns('우리나라에는 무릎 치료를 잘하는 정형외과가 없는가!')
# ['우리', '나라', '무릎', '치료', '정형외과']

mecab.pos('자연주의 쇼핑몰은 어떤 곳인가?')
# [('자연주의', 'NNG'), ('쇼핑몰', 'NNG'), ('은', 'JX'), ('어떤', 'MM'), ('곳', 'NNG'), ('인가', 'VCP+EF'), ('?', 'SF')]

mecab.parse('즐거운 하루 보내세요!')
# [
#     ('즐거운', Feature(
#         pos='VA+ETM', semantic=None, has_jongseong=True, reading='즐거운',
#         type='Inflect', start_pos='VA', end_pos='ETM',
#         expression='즐겁/VA/*+ᆫ/ETM/*')),
#     ('하루', Feature(
#         pos='NNG', semantic=None, has_jongseong=False, reading='하루',
#         type=None, start_pos=None, end_pos=None,
#         expression=None)),
#     ('보내', Feature(
#         pos='VV', semantic=None, has_jongseong=False, reading='보내',
#         type=None, start_pos=None, end_pos=None,
#         expression=None)),
#     ('세요', Feature(
#         pos='EP+EF', semantic=None, has_jongseong=False, reading='세요',
#         type='Inflect', start_pos='EP', end_pos='EF',
#         expression='시/EP/*+어요/EF/*')),
#     ('!', Feature(
#         pos='SF', semantic=None, has_jongseong=None, reading=None,
#         type=None, start_pos=None, end_pos=None,
#         expression=None))
# ]

CLI

The library also provides a proxy for several command-line interfaces provided by mecab. These interfaces can be used to add vocabulary to a user dictonary.

  • python3 -m mecab
  • python3 -m mecab dict-index
  • python3 -m mecab dict-gen
  • python3 -m mecab cost-train

User Dictionary

You can build a user dictionary using the above command-line interface:

$ python3 -m mecab dict-index \
    --userdic=user.dic \
    user.csv

NOTE

  • The CSV file must be in the following format:
    • <surface>,*,*,<cost>,<pos>,<semantic>,<has_jongseong>,<reading>,<type>,<start_pos>,<end_pos>,<expression>
  • Example:
    • 트위치,,,,NNP,*,F,트위치,*,*,*,*
    • 플랫폼,,,,NNG,*,T,플랫폼,*,*,*,*

Then, you can add the built user dictionary as follows:

from mecab import MeCab
mecab = MeCab(user_dictionary_path="user.dic")

# If there are multiple dictionaries:
mecab = MeCab(user_dictionary_path=["nnp.dic", "nng.dic"])

Fore more detailed information, please refer to examples/user_dictionary.py.

Acknowledgments

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

python-mecab-ko-1.2.7.tar.gz (10.7 kB view details)

Uploaded Source

Built Distributions

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

python_mecab_ko-1.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (571.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

python_mecab_ko-1.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (550.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

python_mecab_ko-1.2.7-cp311-cp311-macosx_11_0_arm64.whl (599.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

python_mecab_ko-1.2.7-cp311-cp311-macosx_10_9_x86_64.whl (613.3 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

python_mecab_ko-1.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (571.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

python_mecab_ko-1.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (550.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

python_mecab_ko-1.2.7-cp310-cp310-macosx_11_0_arm64.whl (599.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

python_mecab_ko-1.2.7-cp310-cp310-macosx_10_9_x86_64.whl (613.3 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

python_mecab_ko-1.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (573.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

python_mecab_ko-1.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (552.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

python_mecab_ko-1.2.7-cp39-cp39-macosx_11_0_arm64.whl (600.0 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

python_mecab_ko-1.2.7-cp39-cp39-macosx_10_9_x86_64.whl (613.4 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

python_mecab_ko-1.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (571.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

python_mecab_ko-1.2.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (550.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

python_mecab_ko-1.2.7-cp38-cp38-macosx_11_0_arm64.whl (599.8 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

python_mecab_ko-1.2.7-cp38-cp38-macosx_10_9_x86_64.whl (613.3 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

python_mecab_ko-1.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (574.2 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

python_mecab_ko-1.2.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (558.4 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

python_mecab_ko-1.2.7-cp37-cp37m-macosx_10_9_x86_64.whl (611.9 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

Details for the file python-mecab-ko-1.2.7.tar.gz.

File metadata

  • Download URL: python-mecab-ko-1.2.7.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for python-mecab-ko-1.2.7.tar.gz
Algorithm Hash digest
SHA256 0ba90d2cf10497088f9f8067f5f564ffccca944ce3a14c0e617528416d5848ee
MD5 9204d08852a07c3fc64110c8db28bc42
BLAKE2b-256 7272f33215c23bb5550e7af54c856e061a7a1d708964bf8585896143cc69cd81

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5759c40f0705bb64faf81b4c5c129518c1d9603cc82965c79b63b87c00f3f379
MD5 8efdfbfcfe048342343231cfd586b51c
BLAKE2b-256 bca603bb6c5403478f03d443d464d5bf7092a2b9f4adcfc657db2047b34fe8c5

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fb160d4ea1337f863e3d7a397efd9a1739f1fd6369d6e68fa4e0b701c426865d
MD5 d9dc49fc0dfd5df859aa4db833276017
BLAKE2b-256 923a38e992ed042d288f20059ab71c0896120f832b09d47b250d09789f9399a4

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 700300adead6568acf8df7ec1c8a86f01b6c6b274607d8041803877654e22bf3
MD5 74995415b8819b006cfe9f1ccebc3dd3
BLAKE2b-256 a90f55d24c1b0364b9c4701974fa4441eb8e2738e9ef183ac92683679f877070

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 06413ff3221d3b4588c5906d33507786d15996ee8767855dcf88dc914d3d22e9
MD5 503bc1ab931aca2b20787110cbbbe475
BLAKE2b-256 43fc7b04a42b1f083a3e5d9894b10f4ed5577a8d828fa3416da8fa994f9c0b04

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c9809d7522fa319137f2d342931ed7a13882c7cd7ec11c3fdb9d3e848898cdc0
MD5 f35cdaedee5ded3c11dbdf569ea93b08
BLAKE2b-256 e7ef215de87edd25bad76ca157f789729df91003766da9d6e2d47853025b39cd

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 93ac7f39b84ed785625e6b782a02c820e1157aec4495d7819f8c3d9e53fbb1b1
MD5 4d80abeb4686b0a6d20be487884ad3b2
BLAKE2b-256 744032a6b030b7fbb0c55f0226af16892fce30186c0bd3aac5c41c99cd8b49b8

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18fa962ca3b2eecea5bf58889e5ee254a6aa999314e51fe7448d6b6677003ec9
MD5 9b8748aadbfbb999b293eec606253763
BLAKE2b-256 445998ab671d47b64975ac434ba55cab9bd7db9eeda85797106e2714dad81a29

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 04b638163b8c0b249618edd1cc166b8876d8e0bc54fa250e80117417507d4f29
MD5 1b3db8f96540c0cab7c3aa589f54e2f7
BLAKE2b-256 9c55fe5bf5330ee5776dd44a0e5c1551778ce4ef30f7670a349c0c865ae5ad25

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c498e84019816283403cdf33bce9cd58883937fc4ba3f310bd9d2b42433e73d4
MD5 744e1513c12917993f447cfe11c3a866
BLAKE2b-256 4df2736d48f2b2b2e623eb60c4c4454463ede4b3ea5b7c9afa92e89db1fbbdd3

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 404cef34de77360ca2a50b8ffb358fad91ca54f6e022aa2206bc77d4db8bc6c0
MD5 25855314c8a821303d94282f3b033ae2
BLAKE2b-256 0463eca653ec980f7aecf2a7fc05b39179b6e4391b1d994e4de3d1d72dfe8f1d

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 673a0585e51047f5291edf2b04db8d8ea70a22f6f79559287923e412a0727d94
MD5 52a3117da96eb654e69a5407458381aa
BLAKE2b-256 7f33386c8efea491ea1e7b7f251aff544f1b4585766c39f52503992da315585c

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 96cf86a79064e0b190300738927c5b575826a7915f552b4cf0abb67c5fcd7310
MD5 cc42a2ae0f3450e072412d2ae38202fe
BLAKE2b-256 7b0ad5bda92954204b529621ec42717d9b02ab2742f84a1ec4d44d569b2f63f9

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd3bdb25cb0e6eec01d2515cbc9454621378a92445b4808e5d2392382451eda5
MD5 71194c17eb2e2ab18a5a41eb6e243f8c
BLAKE2b-256 16a6faecbeed3efa898fa8b04d0051c9c8963d1577bacd9a76859bce87c4b9f5

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0f2999607777ad5a85824fae654aed0438cf6bc4c48f84ac7bcbe9fce7fdd3c1
MD5 7bae188a3d1442d2d060aeded0c5081d
BLAKE2b-256 3d1a462cab487bc44f1ece39b77b48f7d4ef19bb302fe3f045df9538ab4fe5e9

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad4467e28f47285ac784bd8714d0605b17115e5e78d1c96ff5e8c6ffeb873b02
MD5 641a474698eafc9dbc75edf022c421f4
BLAKE2b-256 fa699ce309e558d5b6bb1d45d559bbded8d1dc6fec99cf9b4efd4630e09ee60f

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 11b6b0fdffd8637f8842c4b4b8b137cfae0ffc493830010433c57f58d5312b44
MD5 b53f129fb669dd544ce38ace94944c59
BLAKE2b-256 a32f606763bf95a4d0ba1f4c06a3cc201f2c35ff9ac4996f289eeaa49c8a3c43

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f14741cea5e9ae91cf85e17b5c1adf2ddcecdb194c0b4b90916dcc4e02f14d1e
MD5 64c8df4e3b310f1aa6fea98838f0315c
BLAKE2b-256 ee4f88ac5fd966bfbcc7e4383f65ac4eee11741e46674f85331ed72836626a76

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6c3a372f74310bb012ba7e2a3d3d6ba8536068dbf4d9c7b0ff219e702f8e65af
MD5 21d6b03c544854c64f526780d0587921
BLAKE2b-256 43fee28f38ad77ffa46ad9716e7aa08424db8a44b8e4a70f68b73b58e8b3dcdd

See more details on using hashes here.

File details

Details for the file python_mecab_ko-1.2.7-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for python_mecab_ko-1.2.7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e6a98dd68792b814b4f17902573ed63d0bfb1a960f529ee992a0beed1d2d5719
MD5 f94d6dd3d14243ebd43ea55e0d15767a
BLAKE2b-256 43326d9504307903682881796981b40dcd9f4cd57959cfca1064d56f43d3642c

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