An open API service indexing awesome lists of open source software.

https://github.com/ajatt-tools/mecab_controller

๐Ÿฃ Mecab wrapper to generate furigana readings.
https://github.com/ajatt-tools/mecab_controller

ajatt furigana japanese mecab python

Last synced: 6 months ago
JSON representation

๐Ÿฃ Mecab wrapper to generate furigana readings.

Awesome Lists containing this project

README

        

# Mecab controller

Mecab controller is a simple wrapper around
[mecab](https://github.com/taku910/mecab) ([AUR](https://aur.archlinux.org/packages/mecab-git)).
It was created primarily to be used in
[AJT Japanese](https://ankiweb.net/shared/info/1344485230),
an [Anki](https://wiki.archlinux.org/title/Anki) add-on
that generates furigana for Japanese text.
Originally based on code from
[Japanese support](https://github.com/ankitects/anki-addons/tree/main/code/japanese).

## Usage with AJT Japanese

This repository is already included with AJT Japanese.
You don't need to do anything extra.

## Standalone usage

```
>>> import mecab_controller
>>> mecab = mecab_controller.MecabController()
>>> print(mecab.reading('ๆ˜จๆ—ฅใ™ใ็„ผใใ‚’้ฃŸในใพใ—ใŸ'))
ๆ˜จๆ—ฅ[ใใฎใ†]ใ™ใ ็„ผ[ใ‚„]ใใ‚’ ้ฃŸ[ใŸ]ในใพใ—ใŸ
```

```
python -m mecab_controller ๆ˜จๆ—ฅใ™ใ็„ผใใ‚’้ฃŸในใพใ—ใŸ
ๆ˜จๆ—ฅ[ใใฎใ†]ใ™ใ ็„ผ[ใ‚„]ใใ‚’ ้ฃŸ[ใŸ]ในใพใ—ใŸ
```