python-mecab-kor

Yet another python binding for mecab-ko

BSD-3-CLAUSE License

Downloads
3.1K
Stars
77
Committers
1
python-mecab-kor - v1.2.8 Latest Release

Published by hyunwoongko over 1 year ago

Fix bugs about homebrew running on the root privilege.

python-mecab-kor - v1.2.6

Published by hyunwoongko almost 2 years ago

Remove GPG related code.

python-mecab-kor - v1.2.5

Published by hyunwoongko almost 2 years ago

  • Add drop_space feature.
  • Add sudo command for MacOS user, it will do not ask your password anymore.
python-mecab-kor - v1.2.4

Published by hyunwoongko almost 2 years ago

python-mecab-kor - v1.2.3

Published by hyunwoongko about 2 years ago

Install python requirements to sudo

python-mecab-kor - v1.2.2

Published by hyunwoongko about 2 years ago

  • Fix fucking pybind install error
python-mecab-kor - v1.2.1

Published by hyunwoongko about 2 years ago

  • Remove shell=True to fix the shell scripts execution order
python-mecab-kor - v1.1.10

Published by hyunwoongko about 2 years ago

  • Add libmecab-dev to requirements
python-mecab-kor - v1.1.8

Published by hyunwoongko about 2 years ago

Install git on brew package manager

python-mecab-kor - v1.1.7

Published by hyunwoongko about 2 years ago

Hot Fix

  • Install python requirements before build_ext.
python-mecab-kor - v1.1.5

Published by hyunwoongko about 2 years ago

v1.1.5

  • M1 Silicon chip support.
python-mecab-kor - v1.1.0

Published by hyunwoongko about 2 years ago

python-mecab-kor


1. Why another package?

Original python-mecab-ko is not being maintained well now,
so I am trying to maintain it myself, and I've fixed a lot of problems about installation.
Be careful that I changed ko to kor because I can't keep the package name same with the original.

2. What OS have you tested successfully so far?

It has been successfully installed on the following OS list.
If the installation succeeds or fails on your OS, please report it through the issue page.
I will do my best to fix your errors.

  • Linux Ubuntu
  • Linux CentOS
  • Amazon Linux
  • Mac OS

Please note that I don't have any plan with Windows OS.

3. Installation

pip install python-mecab-kor

4. Usage

Usage of the package is same with the original.

from mecab import 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))
# ]

5. References