インストール手順
$ sudo apt-get install mecab libmecab-dev mecab-ipadic
$ sudo aptitude install mecab-ipadic-utf8
$ sudo apt-get install python-mecab
mecab_sample.py
# coding: utf-8
import sys
import MeCab
m = MeCab.Tagger ("-Ochasen")
print ("私の名前はボブです。")
print m.parse("私の名前はボブです。")
↓↓実行結果↓↓
私の名前はボブです。
私 ワタシ 私 名詞-代名詞-一般
の ノ の 助詞-連体化
名前 ナマエ 名前 名詞-一般
は ハ は 助詞-係助詞
ボブ ボブ ボブ 名詞-固有名詞-人名-名
です デス です 助動詞 特殊・デス 基本形
。 。 。 記号-句点
EOS
環境: Ubuntu:14.04, python:Python 2.7.6
Sorry, I following this website of content. However, my compliers always show me this error below as:
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Can you tell me why and how to fix it? Thank you very much.