Skip to main content

Python wrapper for CaboCha: Japanese Dependency Structure Analyzer

Project description

cabocha-python

This is a python wrapper for CaboCha Japanese Dependency Structure Analyzer.

NOTE: It does not sopport Windows Python 64bit version.

Japanese document is available.

USAGE

>>> import CaboCha
>>> c = CaboCha.Parser()
>>> sentence = "太郎はこの本を二郎を見た女性に渡した。"
>>> print(c.parseToString(sentence))
太郎は-----------D
    この-D       |
      本を---D   |
      二郎を-D   |
          見た-D |
          女性に-D
          渡した
EOS
>>> tree = c.parse(sentence)
>>> print(tree.toString(CaboCha.FORMAT_TREE))
太郎は-----------D
    この-D       |
      本を---D   |
      二郎を-D   |
          見た-D |
          女性に-D
          渡した
EOS

>>> print(tree.toString(CaboCha.FORMAT_LATTICE))
* 0 6D 0/1 -2.457381
太郎    名詞,固有名詞,人名,,*,*,太郎,タロウ,タロー
     助詞,係助詞,*,*,*,*,,,
* 1 2D 0/0 1.488413
この    連体詞,*,*,*,*,*,この,コノ,コノ
* 2 4D 0/1 0.091699
     名詞,一般,*,*,*,*,,ホン,ホン
     助詞,格助詞,一般,*,*,*,,,
* 3 4D 0/1 2.266072
二郎    名詞,固有名詞,人名,,*,*,二郎,ジロウ,ジロー
     助詞,格助詞,一般,*,*,*,,,
* 4 5D 0/1 1.416783
     動詞,自立,*,*,一段,連用形,見る,,
     助動詞,*,*,*,特殊,基本形,,,
* 5 6D 0/1 -2.457381
女性    名詞,一般,*,*,*,*,女性,ジョセイ,ジョセイ
     助詞,格助詞,一般,*,*,*,,,
* 6 -1D 0/1 0.000000
渡し    動詞,自立,*,*,五段サ行,連用形,渡す,ワタシ,ワタシ
     助動詞,*,*,*,特殊,基本形,,,
     記号,句点,*,*,*,*,,,
EOS

License

CaboCha is copyrighted free software by Taku Kudo <taku@chasen.org> is released under any of the the LGPL (see the file LGPL) or the BSD License (see the file BSD).

CHANGES

0.69.1 (2019-09-21)

  • Avoid the compilation error: ‘Python.h’ file not found
  • Update codes by swig 4.0.1

0.69 (2019-03-04)

First release to PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cabocha-python, version 0.69.1
Filename, size File type Python version Upload date Hashes
Filename, size cabocha_python-0.69.1-cp27-cp27m-win32.whl (479.6 kB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size cabocha_python-0.69.1-cp36-cp36m-win32.whl (485.5 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size cabocha_python-0.69.1-cp37-cp37m-win32.whl (484.7 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size cabocha_python-0.69.1-cp38-cp38-win32.whl (484.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size cabocha-python-0.69.1.tar.gz (49.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page