Skip to main content

Yet another interface to MeCab morphological analyzer

Project description

https://travis-ci.org/kota7/mecabwrap-py.svg?branch=master https://ci.appveyor.com/api/projects/status/oidn1rfte6u8kavs/branch/master?svg=true https://badge.fury.io/py/mecabwrap.svg

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, print_token
>>> for token in tokenize(u"すもももももももものうち"):
...     print_token(token)
...
すもも 名詞,一般,*,*,*,*,すもも,スモモ,スモモ
   助詞,係助詞,*,*,*,*,,,
もも  名詞,一般,*,*,*,*,もも,モモ,モモ
   助詞,係助詞,*,*,*,*,,,
もも  名詞,一般,*,*,*,*,もも,モモ,モモ
   助詞,連体化,*,*,*,*,,,
うち  名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ

Usage

See the example notebook (or a cleaner version on nbviewer) for more detail.

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

mecabwrap-0.3.4.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

mecabwrap-0.3.4-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file mecabwrap-0.3.4.tar.gz.

File metadata

  • Download URL: mecabwrap-0.3.4.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for mecabwrap-0.3.4.tar.gz
Algorithm Hash digest
SHA256 565a0f392e94c881b61ee2a8ef8dd15daba5b67feadc5f4f1cd835e2e8a8f789
MD5 bc3752aec7b634b5e0fc9bca759c113b
BLAKE2b-256 11e288aa1cd3f0f5930d2fd536ca2f83793b8d199bb2bb86123c6ed0fd07191b

See more details on using hashes here.

File details

Details for the file mecabwrap-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: mecabwrap-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for mecabwrap-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 979c43ef7b0b3c946baa01c08ff97eb8ea1f5edf56e2411cbbc1135891cbddbb
MD5 e7973c637b085ef218296066c99bae9e
BLAKE2b-256 c7dc9e1356262052bd2e3e8dac84e86e6c8bdce0b21f605d95af061249ad1d93

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