Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MeCabの使い方の備忘録 / How to use MeCab

Sansan
January 23, 2019

MeCabの使い方の備忘録 / How to use MeCab

■イベント
Sansan Advent Calendar - 2018年を振り返る -
https://sansan.connpass.com/event/112635/

■登壇概要
タイトル:
MeCabの使い方の備忘録

登壇者:
DSOC R&D研究員 高橋寛治

▼Sansan Builders Box
https://buildersbox.corp-sansan.com/

Sansan

January 23, 2019
Tweet

More Decks by Sansan

Other Decks in Technology

Transcript

  1. ௐ΂͕ͪͳDockerfile  FROM python:3.6 WORKDIR /work RUN git clone --depth

    1 https://github.com/taku910/mecab.git RUN cd /work/mecab/mecab && ¥ ./configure --enable-utf8-only && ¥ make && ¥ make install && ¥ ldconfig && ¥ cd /work/mecab/mecab-ipadic && ¥ ./configure --with-charset=utf8 && ¥ make && ¥ make install ¥   
  2. KWICతͳ࢖͍ํ  $ echo "MeCabͰ࢝ΊΔܗଶૉղੳ" | mecab --node- format="%M/%f[0] "

    --eos-format="” MeCab/໊ࢺ Ͱ/ॿࢺ ࢝ΊΔ/ಈࢺ ܗଶૉ/໊ࢺ ղੳ/໊ࢺ $ echo "MeCabͰ࢝ΊΔܗଶૉղੳ" | mecab --node- format="%M/%f[0] " --eos-format="" | grep -oE "¥S+/໊ࢺ” MeCab/໊ࢺ ܗଶૉ/໊ࢺ ղੳ/໊ࢺ