Ubuntu 22.04に形態素解析エンジンMecabをインストールする

環境
OSバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

操作方法
1.aptからMecabをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo apt install mecab libmecab-dev mecab-ipadic-utf8
# sudo apt install mecab libmecab-dev mecab-ipadic-utf8
# sudo apt install mecab libmecab-dev mecab-ipadic-utf8

2.Mecabのバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# mecab -v
mecab of 0.996
# mecab -v mecab of 0.996
# mecab -v
mecab of 0.996

3.Mecabの辞書「mecab-ipadic-NEologd」をインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# git clone https://github.com/neologd/mecab-ipadic-neologd.git
# git clone https://github.com/neologd/mecab-ipadic-neologd.git
# git clone https://github.com/neologd/mecab-ipadic-neologd.git

インストールを行います

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cd mecab-ipadic-neologd
# sudo bin/install-mecab-ipadic-neologd
[install-mecab-ipadic-NEologd] : Start..
[install-mecab-ipadic-NEologd] : Check the existance of libraries
# cd mecab-ipadic-neologd # sudo bin/install-mecab-ipadic-neologd [install-mecab-ipadic-NEologd] : Start.. [install-mecab-ipadic-NEologd] : Check the existance of libraries
# cd mecab-ipadic-neologd
# sudo bin/install-mecab-ipadic-neologd
[install-mecab-ipadic-NEologd] : Start..
[install-mecab-ipadic-NEologd] : Check the existance of libraries

 

Ubuntu 22.04

Posted by arkgame