0
0

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 3 years have passed since last update.

Ubuntu 16.04にmecabをインストール

Last updated at Posted at 2020-08-11

概要

markov連鎖による文章の自動生成がしたくて,その準備としてmecabをインストールする.

実装環境

codeanywhereのContainer

  • Ubuntu 16.04
  • Python 3.7.0

インストールと実行

インストール

$ sudo apt install mecab libmecab-dev mecab-ipadic-utf8

追加辞書のインストール

$ git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git
$ cd mecab-ipadic-neologd
$ sudo ./bin/install-mecab-ipadic-neologd -n -a
$ cd 最初にいたディレクトリへのパス

実行

terminalにmecabと入力するとmecabが起動し,その後文章を入力すると形態素解析されます.

$ mecab
こんにちは.今日はいい天気ですね.

実行結果

こんにちは      感動詞,*,*,*,*,*,こんにちは,コンニチハ,コンニチワ
.      記号,句点,*,*,*,*,.,.,.
今日    名詞,副詞可能,*,*,*,*,今日,キョウ,キョー
は      助詞,係助詞,*,*,*,*,は,ハ,ワ
いい    形容詞,自立,*,*,形容詞・イイ,基本形,いい,イイ,イイ
天気    名詞,一般,*,*,*,*,天気,テンキ,テンキ
です    助動詞,*,*,*,特殊・デス,基本形,です,デス,デス
ね      助詞,終助詞,*,*,*,*,ね,ネ,ネ
.      記号,句点,*,*,*,*,.,.,.
EOS

mecabを終了する際はCtrl+Cです.

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?