LoginSignup
1
0

More than 1 year has passed since last update.

Ubuntu 22.04にmecab-ipadic-neologdをインストール

Posted at
sudo apt update \
  && sudo apt install -y mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file python3-pip \
  && pip install mecab-python3 \
  && git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git \
  && cd mecab-ipadic-neologd \
  && ./bin/install-mecab-ipadic-neologd -n -y

テスト

echo "import MeCab
tagger = MeCab.Tagger('-Ochasen -d /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd')
print(tagger.parse('鬼滅の刃'))" | MECABRC=/etc/mecabrc python3
鬼滅の刃	キメツノヤイバ	鬼滅の刃	名詞-固有名詞-一般		
EOS

エビデンス

参考

1
0
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
0