Skip to content

Instantly share code, notes, and snippets.

@y-krn
Created May 8, 2020 12:55
Show Gist options
  • Save y-krn/66b6686421cbaf5560c7c78fabc2696e to your computer and use it in GitHub Desktop.
Save y-krn/66b6686421cbaf5560c7c78fabc2696e to your computer and use it in GitHub Desktop.
FROM python:3.8
# MeCab
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y libmecab2 libmecab-dev mecab mecab-utils nkf
# ipadic
RUN wget -O mecab-ipadic-2.7.0-20070801.tar.gz "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7MWVlSDBCSXZMTXM"
RUN tar xvzf mecab-ipadic-2.7.0-20070801.tar.gz
RUN nkf --overwrite -Ew mecab-ipadic-2.7.0-20070801/*
# Neologd
RUN git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git
RUN xz -dkv mecab-ipadic-neologd/seed/*seed*
RUN mv mecab-ipadic-neologd/seed/*.csv mecab-ipadic-2.7.0-20070801/
WORKDIR /mecab-ipadic-2.7.0-20070801
RUN /usr/lib/mecab/mecab-dict-index -f utf-8 -t utf-8
RUN ./configure && make install
RUN echo 'dicdir=/usr/lib/x86_64-linux-gnu/mecab/dic/ipadic' > /etc/mecabrc
@y-krn
Copy link
Author

y-krn commented May 8, 2020

PythonコンテナでMeCab + NEologdを実行するためのDockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment