1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MeCabの「-Ochasen」使用時にエラーが出る場合

Posted at

エラー内容

ERROR内容
前略

issueを英語で書く必要はありません。

------------------- ERROR DETAILS ------------------------
arguments: -Ochasen
error message:  [!tmp.empty()] unknown format type [chasen]

---------------------------------------------------------------------------

こんなエラーで悩んでいませんか?
私が解決した方法を共有します。

解決方法

ipadicをインストールします。

cmd
>>pip install ipadic

あとは下記の様に指定します。

test.py
import MeCab
import ipadic

CHASEN_ARGS = r' -F "%m\t%f[7]\t%f[6]\t%F-[0,1,2,3]\t%f[4]\t%f[5]\n"'
CHASEN_ARGS += r' -U "%m\t%m\t%m\t%F-[0,1,2,3]\t\t\n"'

tagger = MeCab.Tagger(ipadic.MECAB_ARGS + CHASEN_ARGS)

print(tagger.parse("私がリンゴを食べました"))

参考元

今回はGithub(ページ)にて記載していたエラー解決方法です。
中々見つからずいつも困っていたので備忘録として記録しました。

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?