Skip to main content

A Cython wrapper for MeCab

Project description

fugashi

Fugashi by Irasutoya

Fugashi is a Cython wrapper for MeCab. It doesn't attempt to cover all of the potential use cases of MeCab, instead dealing with only the most common ones.

  • Only UniDic is supported, you can't use IPADic. UniDic Neologd is fine.
  • Only UTF-8 is supported.
  • Only Python3 is supported.

See the blog post for background on why Fugashi exists and some of the design decisions.

Usage

from fugashi import Tagger

tagger = Tagger('-Owakati')
text = "麩菓子(ふがし)は、麩を主材料とした日本の菓子。"
tagger.parse(text)
# => '麩 菓子 ( ふ が し ) は 、 麩 を 主材 料 と し た 日本 の 菓子 。'
for word in tagger.parseToNodeList(text):
    print(word, word.feature.lemma, word.pos, sep='\t')
    # "feature" is the Unidic feature data as a named tuple

Alternatives

If you have a problem with Fugashi feel free to open an issue. However, there are some cases where it might be better to use a different library.

  • If you want to use MeCab but don't have a C compiler, use natto-py.
  • If you don't want to deal with installing MeCab at all, try SudachiPy.

Note that these are both slower than Fugashi according to a benchmark I wrote.

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

fugashi-0.1.6.tar.gz (51.6 kB view details)

Uploaded Source

File details

Details for the file fugashi-0.1.6.tar.gz.

File metadata

  • Download URL: fugashi-0.1.6.tar.gz
  • Upload date:
  • Size: 51.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for fugashi-0.1.6.tar.gz
Algorithm Hash digest
SHA256 fada3cada3d5fa4d3fa804359b1b36df76c2ce22fe9d304bcd7a9d4094e6c8db
MD5 3947d70e405904c9b3a5c0ccf6da76a0
BLAKE2b-256 30fcc5344914d1bae91682e13f5a85c47ecbeb71814a325283212d7b983a38c7

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