python-mecab-kor


Namepython-mecab-kor JSON
Version 1.2.8 PyPI version JSON
download
home_pagehttps://github.com/hyunwoongko/python-mecab-kor
SummaryYet another python binding for mecab-ko
upload_time2023-05-16 18:31:56
maintainer
docs_urlNone
authorHyunwoong Ko
requires_python>=3
licenseBSD
keywords mecab mecab-ko python-mecab python-mecab-ko python-mecab-kor
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # python-mecab-kor
<a href="https://github.com/hyunwoongko/python-mecab-kor/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/hyunwoongko/python-mecab-kor.svg" /></a>
<a href="https://github.com/hyunwoongko/python-mecab-kor/issues"><img alt="Issues" src="https://img.shields.io/github/issues/hyunwoongko/python-mecab-kor"/></a>

## 1. Why another package? 
[python-mecab-ko](https://github.com/jonghwanhyeon/python-mecab-ko) is great package but sadly it is not being maintained well now.
So I decided to maintain it myself and I've fixed a lot of problems about installation.
Be careful that the package name is 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](https://github.com/hyunwoongko/python-mecab-kor/issues). 
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

```python
from mecab import MeCab

mecab = MeCab()

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

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

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

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

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

mecab.parse('즐거운 하루\n보내세요!')
# [
#     ('즐거운', 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))
# ]

# drop_space=False
mecab.parse('즐거운 하루\n보내세요!', drop_space=False)
# [
#     ('즐거운', Feature(
#         pos='VA+ETM', semantic=None, has_jongseong=True, reading='즐거운',
#         type='Inflect', start_pos='VA', end_pos='ETM',
#         expression='즐겁/VA/*+ᆫ/ETM/*')),
#     (' ', Feature(
#         pos='SP', semantic=None, has_jongseong=None, reading=None,
#         type=None, start_pos=None, end_pos=None,
#         expression=None)),
#     ('하루', Feature(
#         pos='NNG', semantic=None, has_jongseong=False, reading='하루',
#         type=None, start_pos=None, end_pos=None,
#         expression=None)),
#     ('\n', Feature(
#         pos='SP', semantic=None, has_jongseong=None, reading=None,
#         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
- [konlpy](https://github.com/konlpy/konlpy/)
- [python-mecab-ko](https://github.com/jonghwanhyeon/python-mecab-ko)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hyunwoongko/python-mecab-kor",
    "name": "python-mecab-kor",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": "",
    "keywords": "mecab mecab-ko python-mecab python-mecab-ko python-mecab-kor",
    "author": "Hyunwoong Ko",
    "author_email": "gusdnd852@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2c/2e/7917319425c0f5b8afc80274387ab9613240ff64a4b7c32d23962c5c9dcd/python-mecab-kor-1.2.8.tar.gz",
    "platform": null,
    "description": "# python-mecab-kor\n<a href=\"https://github.com/hyunwoongko/python-mecab-kor/releases\"><img alt=\"GitHub release\" src=\"https://img.shields.io/github/release/hyunwoongko/python-mecab-kor.svg\" /></a>\n<a href=\"https://github.com/hyunwoongko/python-mecab-kor/issues\"><img alt=\"Issues\" src=\"https://img.shields.io/github/issues/hyunwoongko/python-mecab-kor\"/></a>\n\n## 1. Why another package? \n[python-mecab-ko](https://github.com/jonghwanhyeon/python-mecab-ko) is great package but sadly it is not being maintained well now.\nSo I decided to maintain it myself and I've fixed a lot of problems about installation.\nBe careful that the package name is changed `ko` to `kor` because I can't keep the package name same with the original.\n\n## 2. What OS have you tested successfully so far?\nIt has been successfully installed on the following OS list.\nIf the installation succeeds or fails on your OS, please report it through the [issue page](https://github.com/hyunwoongko/python-mecab-kor/issues). \nI will do my best to fix your errors. \n\n- Linux Ubuntu\n- Linux CentOS\n- Amazon Linux\n- Mac OS\n\n**Please note that I don't have any plan with Windows OS.**\n\n## 3. Installation\n```\npip install python-mecab-kor\n```\n\n## 4. Usage\n\n```python\nfrom mecab import MeCab\n\nmecab = MeCab()\n\nmecab.morphs('\uc601\ub4f1\ud3ec\uad6c\uccad\uc5ed\uc5d0 \uc788\ub294 \ub9db\uc9d1 \uc880 \uc54c\ub824\uc8fc\uc138\uc694.')\n# ['\uc601\ub4f1\ud3ec\uad6c\uccad\uc5ed', '\uc5d0', '\uc788', '\ub294', '\ub9db\uc9d1', '\uc880', '\uc54c\ub824', '\uc8fc', '\uc138\uc694', '.']\n\n# drop_space=False\nmecab.morphs('\uc601\ub4f1\ud3ec\uad6c\uccad\uc5ed\uc5d0 \uc788\ub294 \ub9db\uc9d1 \uc880 \uc54c\ub824\uc8fc\uc138\uc694.', drop_space=False)\n# ['\uc601\ub4f1\ud3ec\uad6c\uccad\uc5ed', '\uc5d0', ' ', '\uc788', '\ub294', ' ', '\ub9db\uc9d1', ' ', '\uc880', ' ', '\uc54c\ub824', '\uc8fc', '\uc138\uc694', '.']\n\nmecab.nouns('\uc6b0\ub9ac\ub098\ub77c\uc5d0\ub294 \ubb34\ub98e \uce58\ub8cc\ub97c \uc798\ud558\ub294 \uc815\ud615\uc678\uacfc\uac00 \uc5c6\ub294\uac00!')\n# ['\uc6b0\ub9ac', '\ub098\ub77c', '\ubb34\ub98e', '\uce58\ub8cc', '\uc815\ud615\uc678\uacfc']\n\nmecab.pos('\uc790\uc5f0\uc8fc\uc758 \uc1fc\ud551\ubab0\uc740 \uc5b4\ub5a4 \uacf3\uc778\uac00?')\n# [('\uc790\uc5f0\uc8fc\uc758', 'NNG'), ('\uc1fc\ud551\ubab0', 'NNG'), ('\uc740', 'JX'), ('\uc5b4\ub5a4', 'MM'), ('\uacf3', 'NNG'), ('\uc778\uac00', 'VCP+EF'), ('?', 'SF')]\n\n# drop_space=False\nmecab.pos('\uc790\uc5f0\uc8fc\uc758 \uc1fc\ud551\ubab0\uc740 \uc5b4\ub5a4 \uacf3\uc778\uac00?', drop_space=False)\n# [('\uc790\uc5f0\uc8fc\uc758', 'NNG'), (' ', 'SP'), ('\uc1fc\ud551\ubab0', 'NNG'), ('\uc740', 'JX'), (' ', 'SP'), ('\uc5b4\ub5a4', 'MM'), (' ', 'SP'), ('\uacf3', 'NNG'), ('\uc778\uac00', 'VCP+EF'), ('?', 'SF')]\n\nmecab.parse('\uc990\uac70\uc6b4 \ud558\ub8e8\\n\ubcf4\ub0b4\uc138\uc694!')\n# [\n#     ('\uc990\uac70\uc6b4', Feature(\n#         pos='VA+ETM', semantic=None, has_jongseong=True, reading='\uc990\uac70\uc6b4',\n#         type='Inflect', start_pos='VA', end_pos='ETM',\n#         expression='\uc990\uac81/VA/*+\u11ab/ETM/*')),\n#     ('\ud558\ub8e8', Feature(\n#         pos='NNG', semantic=None, has_jongseong=False, reading='\ud558\ub8e8',\n#         type=None, start_pos=None, end_pos=None,\n#         expression=None)),\n#     ('\ubcf4\ub0b4', Feature(\n#         pos='VV', semantic=None, has_jongseong=False, reading='\ubcf4\ub0b4',\n#         type=None, start_pos=None, end_pos=None,\n#         expression=None)),\n#     ('\uc138\uc694', Feature(\n#         pos='EP+EF', semantic=None, has_jongseong=False, reading='\uc138\uc694',\n#         type='Inflect', start_pos='EP', end_pos='EF',\n#         expression='\uc2dc/EP/*+\uc5b4\uc694/EF/*')),\n#     ('!', Feature(\n#         pos='SF', semantic=None, has_jongseong=None, reading=None,\n#         type=None, start_pos=None, end_pos=None,\n#         expression=None))\n# ]\n\n# drop_space=False\nmecab.parse('\uc990\uac70\uc6b4 \ud558\ub8e8\\n\ubcf4\ub0b4\uc138\uc694!', drop_space=False)\n# [\n#     ('\uc990\uac70\uc6b4', Feature(\n#         pos='VA+ETM', semantic=None, has_jongseong=True, reading='\uc990\uac70\uc6b4',\n#         type='Inflect', start_pos='VA', end_pos='ETM',\n#         expression='\uc990\uac81/VA/*+\u11ab/ETM/*')),\n#     (' ', Feature(\n#         pos='SP', semantic=None, has_jongseong=None, reading=None,\n#         type=None, start_pos=None, end_pos=None,\n#         expression=None)),\n#     ('\ud558\ub8e8', Feature(\n#         pos='NNG', semantic=None, has_jongseong=False, reading='\ud558\ub8e8',\n#         type=None, start_pos=None, end_pos=None,\n#         expression=None)),\n#     ('\\n', Feature(\n#         pos='SP', semantic=None, has_jongseong=None, reading=None,\n#         type=None, start_pos=None, end_pos=None,\n#         expression=None)),\n#     ('\ubcf4\ub0b4', Feature(\n#         pos='VV', semantic=None, has_jongseong=False, reading='\ubcf4\ub0b4',\n#         type=None, start_pos=None, end_pos=None,\n#         expression=None)),\n#     ('\uc138\uc694', Feature(\n#         pos='EP+EF', semantic=None, has_jongseong=False, reading='\uc138\uc694',\n#         type='Inflect', start_pos='EP', end_pos='EF',\n#         expression='\uc2dc/EP/*+\uc5b4\uc694/EF/*')),\n#     ('!', Feature(\n#         pos='SF', semantic=None, has_jongseong=None, reading=None,\n#         type=None, start_pos=None, end_pos=None,\n#         expression=None))\n# ]\n\n```\n\n## 5. References\n- [konlpy](https://github.com/konlpy/konlpy/)\n- [python-mecab-ko](https://github.com/jonghwanhyeon/python-mecab-ko)\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Yet another python binding for mecab-ko",
    "version": "1.2.8",
    "project_urls": {
        "Homepage": "https://github.com/hyunwoongko/python-mecab-kor"
    },
    "split_keywords": [
        "mecab",
        "mecab-ko",
        "python-mecab",
        "python-mecab-ko",
        "python-mecab-kor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c2e7917319425c0f5b8afc80274387ab9613240ff64a4b7c32d23962c5c9dcd",
                "md5": "1b7c8c7a5d1ef94e2ea046e7b9efde79",
                "sha256": "7cb8d04d583f736327eb6bbecabb0c68ef9cea91c10d0265419ec6b0643c5b64"
            },
            "downloads": -1,
            "filename": "python-mecab-kor-1.2.8.tar.gz",
            "has_sig": false,
            "md5_digest": "1b7c8c7a5d1ef94e2ea046e7b9efde79",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 12538,
            "upload_time": "2023-05-16T18:31:56",
            "upload_time_iso_8601": "2023-05-16T18:31:56.431149Z",
            "url": "https://files.pythonhosted.org/packages/2c/2e/7917319425c0f5b8afc80274387ab9613240ff64a4b7c32d23962c5c9dcd/python-mecab-kor-1.2.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-16 18:31:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hyunwoongko",
    "github_project": "python-mecab-kor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "python-mecab-kor"
}
        
Elapsed time: 0.06611s