Help us understand the problem. What is going on with this article?

Python3でmecabを使う

More than 3 years have passed since last update.

公式サイトに書いてあったsetup.pyを使う方法がうまく行かなかった。

ダメ元でpip searchしてみたらパッケージが見つかって、使ってみたらとりあえず動いたので共有。

  • Python 3.4.3 :: Anaconda 2.3.0
  • mecab 0.996
  • mecab-ipadic 102
$ pip install mecab-python3

インタープリターで確認

$ python3
>>> import MeCab
>>> mecab = MeCab.Tagger("-Ochasen")
>>> print(mecab.parse("今日はいい天気ですね。"))
今日  キョウ   今日  名詞-副詞可能
は ハ は 助詞-係助詞
いい  イイ  いい  形容詞-自立    形容詞・イイ  基本形
天気  テンキ   天気  名詞-一般
です  デス  です  助動詞   特殊・デス 基本形
ね ネ ね 助詞-終助詞
。 。 。 記号-句点
EOS

できた。

piruty
関東でプログラマ、やってます。
https://piruty2.hatenablog.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした