Python wrapper for the MeCab morphological analyzer for Japanese
Project description
This is a Python wrapper for the MeCab morphological analyzer for Japanese text. It works with Python 3.4 and greater, as well as Python 2.7.
Basic usage
>>> import MeCab
>>> wakati = MeCab.Tagger("-Owakati")
>>> wakati.parse("pythonが大好きです").split()
['python', 'が', '大好き', 'です']
>>> chasen = MeCab.Tagger("-Ochasen")
>>> print(chasen.parse("pythonが大好きです"))
python python python 名詞-固有名詞-組織
が ガ が 助詞-格助詞-一般
大好き ダイスキ 大好き 名詞-形容動詞語幹
です デス です 助動詞 特殊・デス 基本形
EOS
The API for mecab-python3
closely follows the API for MeCab itself,
even when this makes it not very “Pythonic.” Please consult the MeCab
documentation for more information.
Installation
Binary wheels are available for MacOS X and Linux, and are installed
by default when you use pip
:
pip install mecab-python3
These wheels include an internal (statically linked) copy of the MeCab
library, and a copy of the mecab-ipadic
dictionary (using
UTF-8 text encoding), which is automatically used by default. If you
wish to use a different dictionary, you will need to install it
yourself, write a mecabrc
file directing MeCab to use it, and set
the environment variable MECABRC
to point to this file.
To build from source using pip,
pip install --no-binary :all: mecab-python3
Alternatively, you can use pip to download the source, then build it by hand:
pip download --no-binary :all: mecab-python3
tar zxf mecab-python3-{version}.tar.gz
cd mecab-python3-{version}
python3 setup.py build
# install as you like
When the module is built from source, it requires the system to
provide the MeCab library and at least one dictionary. You must have
SWIG, the MeCab library and headers, and a dictionary installed
before running pip install
or setup.py build
. For instance, on
Debian-based Linux,
sudo apt-get install swig libmecab-dev mecab-ipadic-utf8
Building wheels with a bundled library and dictionary is only
supported in a sanitized CI environment. Consult the scripts in the
scripts
subdirectory of the source tree to see how it’s done.
Licensing
Like MeCab itself, mecab-python3
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
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 Distributions
Hashes for mecab_python3-0.996.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3efc3a61fc9bbc3e33b44ac5d1ff6a5b1773e294870e8f580c888067c0c73db3 |
|
MD5 | 74046739f387966c5ad1844ab1b79a4f |
|
BLAKE2b-256 | ddf36fe13dba17a7f81484b5e86e2db270617ad1cf8a7d2a9d1abf7fc5eea72b |
Hashes for mecab_python3-0.996.2-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 700a693e30cbe2640ae1793a9c7b6b3744b4dd543e7f3d36fc9b936d1becf9a0 |
|
MD5 | 86a98b87aadda21b1fa0668eecb846f2 |
|
BLAKE2b-256 | 8cb95fe5113a99abf066b9192d42baf9e5b4711470ce73f25ecca3de5dbc7014 |
Hashes for mecab_python3-0.996.2-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ef0fa0a91497943b57efa00e047470d19118551cb0023c27663a2c1c56e24bf |
|
MD5 | 2184b81768e50b1763562f1363c93979 |
|
BLAKE2b-256 | 4ac0ffbfaf1b4721117e12bc169bc46d49a6c37143ce94388c80b256cd405f00 |
Hashes for mecab_python3-0.996.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6de1a76d53b9ffc3bbeda47ce1a817c825b668f6afa748691abfcb458b099eaf |
|
MD5 | 2c4f5c9bc639af92ecc68005ae8145a1 |
|
BLAKE2b-256 | b392e7e7f38df8457fa40c1ca86928be5ddbe2bf341e90a35e6ada30d03ef16d |
Hashes for mecab_python3-0.996.2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49befe46c1672984285d1c1f4a26781ede6bc536e7994ab1960aedadfab5b28a |
|
MD5 | 16fa6fecfc5423ce947d22ca5570b82f |
|
BLAKE2b-256 | 8bfbb56c175a7e18bc6efcea5ba9cf52972a9898d0996ebd53a0e533c0427a7e |
Hashes for mecab_python3-0.996.2-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8715bd6127ad3a1d629986e5dba9971598f6a38233b539d3c482ee297be7bb |
|
MD5 | ce16663bce855ac71eba196c86b87d6b |
|
BLAKE2b-256 | 979f3e5755e0488f608e3c2d18a0f3524434ebf36904b8fd4eec74a3e84416a9 |
Hashes for mecab_python3-0.996.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68746e30c2e094175619c4b586704e18b2b52af066ad67739a0a9060089faecd |
|
MD5 | a902172ed8ee284985421c069393dfa7 |
|
BLAKE2b-256 | b1421e71708d577cf2f1013da6e33f0fc96fd8360aa272006da17c7d9a546a7b |
Hashes for mecab_python3-0.996.2-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c854a705adfecd8ceb7d377510fe8741a3ff735af749e81cdac0099ffe9999f5 |
|
MD5 | 1d7a1740e2fa6cd7bdd663be45aa4536 |
|
BLAKE2b-256 | aed942f5c760856956cf5f8f374abbece4e0447ffbee1d96c265b2827b019fc1 |
Hashes for mecab_python3-0.996.2-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8392a7f9681506635d5a9bd232f8eee8e0ebafe52bfcb70a53a755bdd94aba23 |
|
MD5 | 62b6241ab6a1215f2a422b094d47abd4 |
|
BLAKE2b-256 | 7a9814476918f2f722af851fede47dc39a99ebe4423454960d5afd930aa9570c |
Hashes for mecab_python3-0.996.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc143b4f49894a4c76d9847da6655b6fe2cff29909f610c0e3da8a8e615985ac |
|
MD5 | 32f91de5e7adbe75ef622685d4b04c43 |
|
BLAKE2b-256 | 36b718016782efdd5062179c8f81685720710fc73eca49509d5f5feca768ad1c |
Hashes for mecab_python3-0.996.2-cp34-cp34m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd633171d4d9bb47f8fc4e2ee0cc720cc7ed001ea44a074bc15ef1b3ec47d3ba |
|
MD5 | 695ede4ae7a00b6a336327b04be53dc4 |
|
BLAKE2b-256 | 2682a5720efa4e25e7a4d25a6b0eaa56a5ebfa5957354b032ae17a167f095d3b |
Hashes for mecab_python3-0.996.2-cp34-cp34m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d155f8cc9118631c3bd0975144cf603272f23e57228022c4eedba8a52cd34cf |
|
MD5 | d6fbb80455ef9971b7a6ca9c8b85c472 |
|
BLAKE2b-256 | 0ac69216689cc05e5848b35efaf7b902902a36a680008630dac2ef2810c3f668 |
Hashes for mecab_python3-0.996.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5265730069d8915df57aba282a7ac5acc682c6cad27fdde0be12f97577b54d38 |
|
MD5 | b41cda209a7f138cfda2ba253e93b271 |
|
BLAKE2b-256 | 40e9b6ba6580537a5261f615537f02a2a5be43652a653196e0e2d165934ac1af |
Hashes for mecab_python3-0.996.2-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da6f1992d7345c6973fab61572f54fb54dfc0c7ebebffedaa66fc6cc35c475eb |
|
MD5 | 10bdc001d6112cdb78c2cfb1eae3e556 |
|
BLAKE2b-256 | 936eec579119a965df3bc1f41926ab8e608b19bd327fd45fd5c0f328deff8d47 |
Hashes for mecab_python3-0.996.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f87ad5a3d928b8b14bcb63d629a580bc4967cdb6f7a66c362598e54aa97881d0 |
|
MD5 | 260c2e592b47b899285c4f29f82c9ab5 |
|
BLAKE2b-256 | ca427bb6fefc7dc8a749ce0acd02caf2803a890e33cdc3a5dbfe0662d60763ad |
Hashes for mecab_python3-0.996.2-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97251561991382f5c62ba6a71472e7f9aa4e5f7dca6b4a827e1e140401be0fc7 |
|
MD5 | 5c44860e6844d7af12a66be2d0705b89 |
|
BLAKE2b-256 | 2763b11b8d33ee53682202b9882bcd1d492cd21c9923a4b7d099f0426fb0954b |
Hashes for mecab_python3-0.996.2-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd5668e1f918cc22791749253720b84d1f219ace36c780e75662a202bd80a0a3 |
|
MD5 | 2f9edbcb966a8935858188454e4a4fcc |
|
BLAKE2b-256 | 04026a5bd49f7cab4df4981a880a125e37cb0ed51d450b3c15a6ff5aca4824ec |