/mecab_controller

๐Ÿฃ Mecab wrapper to generate furigana readings.

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

Mecab controller

Mecab controller is a simple wrapper around mecab (AUR). It was created primarily to be used in AJT Japanese, an Anki add-on that generates furigana for Japanese text. Originally based on code from Japanese support.

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 ๆ˜จๆ—ฅใ™ใ็„ผใใ‚’้ฃŸในใพใ—ใŸ
ๆ˜จๆ—ฅ[ใใฎใ†]ใ™ใ ็„ผ[ใ‚„]ใใ‚’ ้ฃŸ[ใŸ]ในใพใ—ใŸ