Yet another interface to MeCab morphological analyzer
Project description
mecabwrap is yet another Python interface to MeCab Morphological Analyzer.
Its goal is to provide intuitive APIs that work on Unix and Windows machines seamlessly.
Requirement
Python 2.7+ or 3.4+ (May also work on older versions)
MeCab 0.996
Installation
1. Install MeCab
Ubuntu
$ sudo apt-get install mecab libmecab-dev mecab-ipadic-utf8
Mac OSX
$ brew install mecab mecab-ipadic
Windows
Download and run the installer.
See also: official website
2. Install this Package
Install from PyPI
$ pip install mecabwrap
or, from GitHub
$ git clone --depth 1 https://github.com/kota7/mecabwrap-py.git
$ cd mecabwrap-py
$ pip install -U .
Quick Check
Following command will print the MeCab version. Otherwise, you do not have MeCab installed or MeCab is not on the search path.
$ mecab -v
# should print `mecab of 0.996` or similar.
To verify that the package is successfully installed, try the following:
$ python
>>> from mecabwrap import tokenize
>>> for token in tokenize(u"すもももももももものうち"):
... print(token)
...
すもも 名詞,一般,*,*,*,*,すもも,スモモ,スモモ
も 助詞,係助詞,*,*,*,*,も,モ,モ
もも 名詞,一般,*,*,*,*,もも,モモ,モモ
も 助詞,係助詞,*,*,*,*,も,モ,モ
もも 名詞,一般,*,*,*,*,もも,モモ,モモ
の 助詞,連体化,*,*,*,*,の,ノ,ノ
うち 名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ
Usage
See the example notebook (or a cleaner version on nbviewer) for more detail.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mecabwrap-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 705d0d7621baeef3779d831521d5ea044c4e5152c359f52f97cf1d55aac79a0a |
|
MD5 | 2aeae53e7ed02fb6801a3cb1f0921a7a |
|
BLAKE2b-256 | 844e63dfb5027ecc0666e123a249d15a42d47ac45e88108503441e400eada77b |