How to run MeCab on Ubuntu 18.04 LTS Python

Here is a summary of how to run MeCab in Python on Ubuntu 18.04 LTS.

Install MeCab

  1. Execute the sudo apt install mecab libmecab-dev mecab-ipadic-utf8 command to install MeCab.
  2. (If none of the following applies, skip it)
  1. Run the sudo apt install git make curl xz-utils file command to install the required packages.
  2. Run the cd / tmp command and change to the tmp directory.
  3. Execute the git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git command to clone mecab-ipadic-NEologd.
  4. Execute the cd mecab-ipadic-neologd command and change to the cloned directory.
  5. Run the ./bin/install-mecab-ipadic-neologd -n command to install mecab-ipadic-NEologd.
  1. Install UniDic.
  1. Run the sudo apt install unidic-mecab command to install UniDic.
  2. Run the sudo update-alternatives --config mecab-dictionary command to change the default dictionary to UniDic.
  1. From "UniDic" National Institute for Japanese Language and Language Short Unit Automatic Analysis Dictionary | Latest Version Download to the latest version [UniDic](http://unidic.ninjal. Download ac.jp/).
  2. Unzip UniDic in the / usr / lib / mecab / dic directory.
  3. [Only when using mecab-unidic-NEologd as a morphological analysis dictionary]
  4. Run the sudo apt install git make curl xz-utils file command to install the required packages.
  5. Run the cd / tmp command and change to the tmp directory.
  6. Execute the git clone --depth 1 https://github.com/neologd/mecab-unidic-neologd command to clone mecab-unidic-NEologd.
  7. Execute the cd mecab-unidic-neologd command to change to the cloned directory.
  8. Run the ./bin/install-mecab-unidic-neologd -n command to install mecab-unidic-NEologd.

Regarding mecab-ipadic-NEeologd and mecab-unidic-NEologd

update

It seems that the update will be done twice a week (Monday, Thursday).

  1. Run the cd / tmp command and change to the tmp directory.
  1. Execute the git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git command to clone mecab-ipadic-NEologd.
  2. Execute the cd mecab-ipadic-neologd command and change to the cloned directory.
  3. Run the ./bin/install-mecab-ipadic-neologd -n command to install mecab-ipadic-NEologd.
  1. Execute the git clone --depth 1 https://github.com/neologd/mecab-unidic-neologd.git command to clone mecab-unidic-NEologd.
  2. Execute the cd mecab-unidic-neologd command to change to the cloned directory.
  3. Run the ./bin/install-mecab-unidic-neologd -n command to install mecab-unidic-NEologd.

How to use the dictionary

For IPAdic and UniDic

Give -d / var / lib / mecab / dic / {dictionary name} to the argument of MeCab.

For mecab-ipadic-NEeologd and mecab-unidic-NEologd

Give -d / usr / lib / mecab / dic / {dictionary name} to the argument of MeCab.

Related article

Recommended Posts

How to run MeCab on Ubuntu 18.04 LTS Python
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
How to run Notepad ++ Python
Python 3.4 pyvenv fails on Ubuntu 14.04 LTS
How to run matplotlib on heroku
How to install Go on Ubuntu
How to build a new python virtual environment on Ubuntu
How to read pydoc on python interpreter
How to use mecab, neologd-ipadic on colab
How to use OpenVPN with Ubuntu 18.04.3 LTS
Steps to install Python environment on Ubuntu
How to erase Python 2.x on Mac.
Memorandum on how to use gremlin python
How to install php7.4 on Linux (Ubuntu)
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
How to run Cython on OSX Memo
How to run a Maya Python script
How to install OpenCV on Cloud9 and run it in Python
Put MicroPython on Windows to run ESP32 on Python
[2020 version] How to install Python3 on AWS EC2
How to install Python
Strategy on how to monetize with Python Java
How to install OpenCV on Jetson Nano Python
[Latest] How to build Java environment on Ubuntu
How to use Python Kivy ④ ~ Execution on Android ~
How to install python
How to update security on Ubuntu 19.10 Eoan Ermine
How to run Leap Motion in non-Apple Python
build Python on Ubuntu
Install Python 3.3 on Ubuntu 12.04
[Python] How to install OpenCV on Anaconda [Windows]
How to build Java environment on Ubuntu (Linux)
Run Python on Apache to view InfluxDB data
How to run GUI programs such as tkinter in Python environment on WSL2
[Python] How to run Jupyter-notebook + pandas + multiprocessing (Pool) [pandas] Memo
Think about how to program Python on the iPad
How to embed mod_wsgi into Apache on Python Windows
How to run python in virtual space (for MacOS)
How to build a Django (python) environment on docker
How to run Self bot on Discord.py [Easy vandalism! ]
How to run setUp only once in python unittest
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
How to use Django on Google App Engine / Python
How to enjoy Python on Android !! Programming on the go !!
How to run Django on IIS on a Windows server
How to build a Python environment on amazon linux 2
Set up Python 3.4 on Ubuntu
Run Jupyter on Ubuntu on Windows
[2020.8 latest] How to install Python
Run Openpose on Python (Windows)
How to install Python [Windows]
Use matplotlib on Ubuntu 12 & Python
python3: How to use bottle (2)
[Python] How to use list 1
How to update Python Tkinter to 8.6
USB Wifi on Ubuntu 20.04LTS
How to register on pypi
How to use Python argparse
Put Python 3.x on Ubuntu
Run Tensorflow 2.x on Python 3.7
Update python on Mac to 3.7-> 3.8