Skip to content

Instantly share code, notes, and snippets.

@uhfx
Last active January 2, 2023 07:50
Show Gist options
  • Save uhfx/6705a2ca29bb429a8ebfc759400c595b to your computer and use it in GitHub Desktop.
Save uhfx/6705a2ca29bb429a8ebfc759400c595b to your computer and use it in GitHub Desktop.
Linux に MeCab をインストール
uhfx@Shuttle-Ubuntu:/etc$ cd ~
uhfx@Shuttle-Ubuntu:~$ ls
mecab-ipadic-neologd ダウンロード デスクトップ ビデオ ミュージック
snap テンプレート ドキュメント ピクチャ 公開
uhfx@Shuttle-Ubuntu:~$ mkdir bachelor
uhfx@Shuttle-Ubuntu:~$ ls
bachelor ダウンロード ドキュメント ミュージック
mecab-ipadic-neologd テンプレート ビデオ 公開
snap デスクトップ ピクチャ
uhfx@Shuttle-Ubuntu:~$ exit
ログアウト
Connection to 10.35.153.76 closed.
user@MacBook-Pro Desktop % scp -r ~/bachelor [email protected]:~/bachelor/
[email protected]'s password:
user@MacBook-Pro Desktop % scp foo.dic [email protected]:/usr/local/lib/mecab/dic/userdic/.
[email protected]'s password:
foo.dic 100% 11KB 615.9KB/s 00:00
uhfx@Shuttle-Ubuntu:/$ cd /etc
uhfx@Shuttle-Ubuntu:/etc$ sudo nano mecabrc
dicdir = /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
uhfx@Shuttle-Ubuntu:~/mecab-ipadic-neologd$ ./bin/install-mecab-ipadic-neologd -n
[install-mecab-ipadic-NEologd] : Start..
[install-mecab-ipadic-NEologd] : Check the existance of libraries
[install-mecab-ipadic-NEologd] : find => ok
[install-mecab-ipadic-NEologd] : sort => ok
[install-mecab-ipadic-NEologd] : head => ok
[install-mecab-ipadic-NEologd] : cut => ok
[install-mecab-ipadic-NEologd] : egrep => ok
[install-mecab-ipadic-NEologd] : mecab => ok
[install-mecab-ipadic-NEologd] : mecab-config => ok
[install-mecab-ipadic-NEologd] : make => ok
[install-mecab-ipadic-NEologd] : curl => ok
[install-mecab-ipadic-NEologd] : sed => ok
[install-mecab-ipadic-NEologd] : cat => ok
[install-mecab-ipadic-NEologd] : diff => ok
[install-mecab-ipadic-NEologd] : tar => ok
[install-mecab-ipadic-NEologd] : unxz => ok
[install-mecab-ipadic-NEologd] : xargs => ok
[install-mecab-ipadic-NEologd] : grep => ok
[install-mecab-ipadic-NEologd] : iconv => ok
[install-mecab-ipadic-NEologd] : patch => ok
[install-mecab-ipadic-NEologd] : which => ok
[install-mecab-ipadic-NEologd] : file => ok
[install-mecab-ipadic-NEologd] : openssl => ok
[install-mecab-ipadic-NEologd] : awk => ok
[install-mecab-ipadic-NEologd] : mecab-ipadic-NEologd is already up-to-date
[install-mecab-ipadic-NEologd] : mecab-ipadic-NEologd will be install to /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
[install-mecab-ipadic-NEologd] : Make mecab-ipadic-NEologd
[make-mecab-ipadic-NEologd] : Start..
[make-mecab-ipadic-NEologd] : Check local seed directory
[make-mecab-ipadic-NEologd] : Check local seed file
[make-mecab-ipadic-NEologd] : Check local build directory
[make-mecab-ipadic-NEologd] : create /home/uhfx/mecab-ipadic-neologd/libexec/../build
[make-mecab-ipadic-NEologd] : Download original mecab-ipadic file
[make-mecab-ipadic-NEologd] : Try to access to https://ja.osdn.net
[make-mecab-ipadic-NEologd] : Try to download from https://ja.osdn.net/frs/g_redir.php?m=kent&f=mecab%2Fmecab-ipadic%2F2.7.0-20070801%2Fmecab-ipadic-2.7.0-20070801.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 11.6M 100 11.6M 0 0 78854 0 0:02:34 0:02:34 --:--:-- 87021
Hash value of /home/uhfx/mecab-ipadic-neologd/libexec/../build/mecab-ipadic-2.7.0-20070801.tar.gz matched
[make-mecab-ipadic-NEologd] : Decompress original mecab-ipadic file
mecab-ipadic-2.7.0-20070801/
mecab-ipadic-2.7.0-20070801/README
mecab-ipadic-2.7.0-20070801/AUTHORS
mecab-ipadic-2.7.0-20070801/COPYING
mecab-ipadic-2.7.0-20070801/ChangeLog
mecab-ipadic-2.7.0-20070801/INSTALL
mecab-ipadic-2.7.0-20070801/Makefile.am
mecab-ipadic-2.7.0-20070801/Makefile.in
mecab-ipadic-2.7.0-20070801/NEWS
mecab-ipadic-2.7.0-20070801/aclocal.m4
mecab-ipadic-2.7.0-20070801/config.guess
mecab-ipadic-2.7.0-20070801/config.sub
mecab-ipadic-2.7.0-20070801/configure
mecab-ipadic-2.7.0-20070801/configure.in
mecab-ipadic-2.7.0-20070801/install-sh
mecab-ipadic-2.7.0-20070801/missing
mecab-ipadic-2.7.0-20070801/mkinstalldirs
mecab-ipadic-2.7.0-20070801/Adj.csv
mecab-ipadic-2.7.0-20070801/Adnominal.csv
mecab-ipadic-2.7.0-20070801/Adverb.csv
mecab-ipadic-2.7.0-20070801/Auxil.csv
mecab-ipadic-2.7.0-20070801/Conjunction.csv
mecab-ipadic-2.7.0-20070801/Filler.csv
mecab-ipadic-2.7.0-20070801/Interjection.csv
mecab-ipadic-2.7.0-20070801/Noun.adjv.csv
mecab-ipadic-2.7.0-20070801/Noun.adverbal.csv
mecab-ipadic-2.7.0-20070801/Noun.csv
mecab-ipadic-2.7.0-20070801/Noun.demonst.csv
mecab-ipadic-2.7.0-20070801/Noun.nai.csv
mecab-ipadic-2.7.0-20070801/Noun.name.csv
mecab-ipadic-2.7.0-20070801/Noun.number.csv
mecab-ipadic-2.7.0-20070801/Noun.org.csv
mecab-ipadic-2.7.0-20070801/Noun.others.csv
mecab-ipadic-2.7.0-20070801/Noun.place.csv
mecab-ipadic-2.7.0-20070801/Noun.proper.csv
mecab-ipadic-2.7.0-20070801/Noun.verbal.csv
mecab-ipadic-2.7.0-20070801/Others.csv
mecab-ipadic-2.7.0-20070801/Postp-col.csv
mecab-ipadic-2.7.0-20070801/Postp.csv
mecab-ipadic-2.7.0-20070801/Prefix.csv
mecab-ipadic-2.7.0-20070801/Suffix.csv
mecab-ipadic-2.7.0-20070801/Symbol.csv
mecab-ipadic-2.7.0-20070801/Verb.csv
mecab-ipadic-2.7.0-20070801/char.def
mecab-ipadic-2.7.0-20070801/feature.def
mecab-ipadic-2.7.0-20070801/left-id.def
mecab-ipadic-2.7.0-20070801/matrix.def
mecab-ipadic-2.7.0-20070801/pos-id.def
mecab-ipadic-2.7.0-20070801/rewrite.def
mecab-ipadic-2.7.0-20070801/right-id.def
mecab-ipadic-2.7.0-20070801/unk.def
mecab-ipadic-2.7.0-20070801/dicrc
mecab-ipadic-2.7.0-20070801/RESULT
[make-mecab-ipadic-NEologd] : Configure custom system dictionary on /home/uhfx/mecab-ipadic-neologd/libexec/../build/mecab-ipadic-2.7.0-20070801-neologd-20200910
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... yes
checking for working aclocal-1.4... missing
checking for working autoconf... missing
checking for working automake-1.4... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking for a BSD-compatible install... /usr/bin/install -c
checking for mecab-config... /usr/bin/mecab-config
configure: creating ./config.status
config.status: creating Makefile
[make-mecab-ipadic-NEologd] : Encode the character encoding of system dictionary resources from EUC_JP to UTF-8
./../../libexec/iconv_euc_to_utf8.sh ./Prefix.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.org.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.number.csv
./../../libexec/iconv_euc_to_utf8.sh ./Postp-col.csv
./../../libexec/iconv_euc_to_utf8.sh ./Postp.csv
./../../libexec/iconv_euc_to_utf8.sh ./Auxil.csv
./../../libexec/iconv_euc_to_utf8.sh ./Symbol.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.nai.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.demonst.csv
./../../libexec/iconv_euc_to_utf8.sh ./Suffix.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.others.csv
./../../libexec/iconv_euc_to_utf8.sh ./Adnominal.csv
./../../libexec/iconv_euc_to_utf8.sh ./Adj.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.proper.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.adjv.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.verbal.csv
./../../libexec/iconv_euc_to_utf8.sh ./Filler.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.adverbal.csv
./../../libexec/iconv_euc_to_utf8.sh ./Adverb.csv
./../../libexec/iconv_euc_to_utf8.sh ./Verb.csv
./../../libexec/iconv_euc_to_utf8.sh ./Others.csv
./../../libexec/iconv_euc_to_utf8.sh ./Conjunction.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.name.csv
./../../libexec/iconv_euc_to_utf8.sh ./Interjection.csv
./../../libexec/iconv_euc_to_utf8.sh ./Noun.place.csv
rm ./Prefix.csv
rm ./Noun.org.csv
rm ./Noun.number.csv
rm ./Postp-col.csv
rm ./Postp.csv
rm ./Auxil.csv
rm ./Symbol.csv
rm ./Noun.nai.csv
rm ./Noun.demonst.csv
rm ./Suffix.csv
rm ./Noun.others.csv
rm ./Adnominal.csv
rm ./Adj.csv
rm ./Noun.proper.csv
rm ./Noun.adjv.csv
rm ./Noun.verbal.csv
rm ./Filler.csv
rm ./Noun.csv
rm ./Noun.adverbal.csv
rm ./Adverb.csv
rm ./Verb.csv
rm ./Others.csv
rm ./Conjunction.csv
rm ./Noun.name.csv
rm ./Interjection.csv
rm ./Noun.place.csv
./../../libexec/iconv_euc_to_utf8.sh ./feature.def
./../../libexec/iconv_euc_to_utf8.sh ./matrix.def
./../../libexec/iconv_euc_to_utf8.sh ./char.def
./../../libexec/iconv_euc_to_utf8.sh ./left-id.def
./../../libexec/iconv_euc_to_utf8.sh ./unk.def
./../../libexec/iconv_euc_to_utf8.sh ./pos-id.def
./../../libexec/iconv_euc_to_utf8.sh ./right-id.def
./../../libexec/iconv_euc_to_utf8.sh ./rewrite.def
rm ./feature.def
rm ./matrix.def
rm ./char.def
rm ./left-id.def
rm ./unk.def
rm ./pos-id.def
rm ./right-id.def
rm ./rewrite.def
mv ./Prefix.csv.utf8 ./Prefix.csv
mv ./Noun.nai.csv.utf8 ./Noun.nai.csv
mv ./Noun.adverbal.csv.utf8 ./Noun.adverbal.csv
mv ./Suffix.csv.utf8 ./Suffix.csv
mv ./feature.def.utf8 ./feature.def
mv ./Postp-col.csv.utf8 ./Postp-col.csv
mv ./Conjunction.csv.utf8 ./Conjunction.csv
mv ./char.def.utf8 ./char.def
mv ./Others.csv.utf8 ./Others.csv
mv ./Interjection.csv.utf8 ./Interjection.csv
mv ./Noun.name.csv.utf8 ./Noun.name.csv
mv ./Noun.others.csv.utf8 ./Noun.others.csv
mv ./rewrite.def.utf8 ./rewrite.def
mv ./left-id.def.utf8 ./left-id.def
mv ./Adj.csv.utf8 ./Adj.csv
mv ./matrix.def.utf8 ./matrix.def
mv ./Auxil.csv.utf8 ./Auxil.csv
mv ./Noun.proper.csv.utf8 ./Noun.proper.csv
mv ./Noun.csv.utf8 ./Noun.csv
mv ./Noun.number.csv.utf8 ./Noun.number.csv
mv ./Noun.org.csv.utf8 ./Noun.org.csv
mv ./Noun.place.csv.utf8 ./Noun.place.csv
mv ./unk.def.utf8 ./unk.def
mv ./Postp.csv.utf8 ./Postp.csv
mv ./pos-id.def.utf8 ./pos-id.def
mv ./Noun.verbal.csv.utf8 ./Noun.verbal.csv
mv ./Symbol.csv.utf8 ./Symbol.csv
mv ./Noun.demonst.csv.utf8 ./Noun.demonst.csv
mv ./Noun.adjv.csv.utf8 ./Noun.adjv.csv
mv ./Adnominal.csv.utf8 ./Adnominal.csv
mv ./Adverb.csv.utf8 ./Adverb.csv
mv ./Filler.csv.utf8 ./Filler.csv
mv ./Verb.csv.utf8 ./Verb.csv
mv ./right-id.def.utf8 ./right-id.def
[make-mecab-ipadic-NEologd] : Fix yomigana field of IPA dictionary
patching file Noun.csv
patching file Noun.place.csv
patching file Verb.csv
patching file Noun.verbal.csv
patching file Noun.name.csv
patching file Noun.adverbal.csv
patching file Noun.csv
patching file Noun.name.csv
patching file Noun.org.csv
patching file Noun.others.csv
patching file Noun.place.csv
patching file Noun.proper.csv
patching file Noun.verbal.csv
patching file Prefix.csv
patching file Suffix.csv
patching file Noun.proper.csv
patching file Noun.csv
patching file Noun.name.csv
patching file Noun.org.csv
patching file Noun.place.csv
patching file Noun.proper.csv
patching file Noun.verbal.csv
patching file Noun.name.csv
patching file Noun.org.csv
patching file Noun.place.csv
patching file Noun.proper.csv
patching file Suffix.csv
patching file Noun.demonst.csv
patching file Noun.csv
patching file Noun.name.csv
[make-mecab-ipadic-NEologd] : Copy user dictionary resource
[make-mecab-ipadic-NEologd] : Install adverb entries using /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-adverb-dict-seed.20150623.csv.xz
[make-mecab-ipadic-NEologd] : Install interjection entries using /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-interjection-dict-seed.20170216.csv.xz
[make-mecab-ipadic-NEologd] : Install noun orthographic variant entries using /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-common-noun-ortho-variant-dict-seed.20170228.csv.xz
[make-mecab-ipadic-NEologd] : Install noun orthographic variant entries using /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-proper-noun-ortho-variant-dict-seed.20161110.csv.xz
[make-mecab-ipadic-NEologd] : Install entries of orthographic variant of a noun used as verb form using /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-noun-sahen-conn-ortho-variant-dict-seed.20160323.csv.xz
[make-mecab-ipadic-NEologd] : Install frequent adjective orthographic variant entries using /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-adjective-std-dict-seed.20151126.csv.xz
[make-mecab-ipadic-NEologd] : Not install /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-adjective-exp-dict-seed.20151126.csv.xz
[make-mecab-ipadic-NEologd] : When you install neologd-adjective-exp-dict-seed.20151126.csv.xz, please set --install_adjective_exp option
[make-mecab-ipadic-NEologd] : Install adjective verb orthographic variant entries using /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-adjective-verb-dict-seed.20160324.csv.xz
[make-mecab-ipadic-NEologd] : Not install /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-date-time-infreq-dict-seed.20190415.csv.xz
[make-mecab-ipadic-NEologd] : When you install neologd-date-time-infreq-dict-seed.20190415.csv.xz, please set --install_infreq_datetime option
[make-mecab-ipadic-NEologd] : Not install /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-quantity-infreq-dict-seed.20190415.csv.xz
[make-mecab-ipadic-NEologd] : When you install neologd-quantity-infreq-dict-seed.20190415.csv.xz, please set --install_infreq_quantity option
[make-mecab-ipadic-NEologd] : Install entries of ill formed words using /home/uhfx/mecab-ipadic-neologd/libexec/../seed/neologd-ill-formed-words-dict-seed.20170127.csv.xz
[make-mecab-ipadic-NEologd] : Re-Index system dictionary
reading ./unk.def ... 40
emitting double-array: 100% |###########################################|
./model.def is not found. skipped.
reading ./Prefix.csv ... 224
reading ./Noun.org.csv ... 17149
reading ./Noun.number.csv ... 42
reading ./neologd-interjection-dict-seed.20170216.csv ... 4701
reading ./Postp-col.csv ... 91
reading ./Postp.csv ... 146
reading ./neologd-adverb-dict-seed.20150623.csv ... 139792
reading ./neologd-common-noun-ortho-variant-dict-seed.20170228.csv ... 152869
reading ./Auxil.csv ... 199
reading ./Symbol.csv ... 208
reading ./Noun.nai.csv ... 42
reading ./neologd-adjective-verb-dict-seed.20160324.csv ... 20268
reading ./Noun.demonst.csv ... 120
reading ./Suffix.csv ... 1448
reading ./Noun.others.csv ... 153
reading ./Adnominal.csv ... 135
reading ./neologd-noun-sahen-conn-ortho-variant-dict-seed.20160323.csv ... 26058
reading ./neologd-ill-formed-words-dict-seed.20170127.csv ... 60616
reading ./Adj.csv ... 27210
reading ./Noun.proper.csv ... 27493
reading ./Noun.adjv.csv ... 3328
reading ./Noun.verbal.csv ... 12150
reading ./mecab-user-dict-seed.20200910.csv ... 3224584
reading ./Filler.csv ... 19
reading ./Noun.csv ... 60734
reading ./Noun.adverbal.csv ... 808
reading ./Adverb.csv ... 3032
reading ./Verb.csv ... 130750
reading ./Others.csv ... 2
reading ./Conjunction.csv ... 171
reading ./Noun.name.csv ... 34215
reading ./Interjection.csv ... 252
reading ./neologd-adjective-std-dict-seed.20151126.csv ... 507812
reading ./neologd-proper-noun-ortho-variant-dict-seed.20161110.csv ... 138379
reading ./Noun.place.csv ... 73194
emitting double-array: 100% |###########################################|
reading ./matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
[make-mecab-ipadic-NEologd] : Make custom system dictionary on /home/uhfx/mecab-ipadic-neologd/libexec/../build/mecab-ipadic-2.7.0-20070801-neologd-20200910
make: 'all' に対して行うべき事はありません.
[make-mecab-ipadic-NEologd] : Finish..
[install-mecab-ipadic-NEologd] : Get results of tokenize test
[test-mecab-ipadic-NEologd] : Start..
[test-mecab-ipadic-NEologd] : Replace timestamp from 'git clone' date to 'git commit' date
[test-mecab-ipadic-NEologd] : Get buzz phrases
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 32106 0 32106 0 0 181k 0 --:--:-- --:--:-- --:--:-- 181k
[test-mecab-ipadic-NEologd] : Get difference between default system dictionary and mecab-ipadic-NEologd
[test-mecab-ipadic-NEologd] : Something wrong. You shouldn't install mecab-ipadic-NEologd yet.
[test-mecab-ipadic-NEologd] : Finish..
[install-mecab-ipadic-NEologd] : Please check the list of differences in the upper part.
[install-mecab-ipadic-NEologd] : Do you want to install mecab-ipadic-NEologd? Type yes or no.
yes
[install-mecab-ipadic-NEologd] : OK. Let's install mecab-ipadic-NEologd.
[install-mecab-ipadic-NEologd] : Start..
[install-mecab-ipadic-NEologd] : /usr/lib/x86_64-linux-gnu/mecab/dic isn't current user's directory
[install-mecab-ipadic-NEologd] : Sudo make install to /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
make[1]: ディレクトリ '/home/uhfx/mecab-ipadic-neologd/build/mecab-ipadic-2.7.0-20070801-neologd-20200910' に入ります
make[1]: 'install-exec-am' に対して行うべき事はありません.
/bin/bash ./mkinstalldirs /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
mkdir /usr/lib/x86_64-linux-gnu/mecab
mkdir /usr/lib/x86_64-linux-gnu/mecab/dic
mkdir /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
/usr/bin/install -c -m 644 ./matrix.bin /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/matrix.bin
/usr/bin/install -c -m 644 ./char.bin /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/char.bin
/usr/bin/install -c -m 644 ./sys.dic /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/sys.dic
/usr/bin/install -c -m 644 ./unk.dic /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/unk.dic
/usr/bin/install -c -m 644 ./left-id.def /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/left-id.def
/usr/bin/install -c -m 644 ./right-id.def /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/right-id.def
/usr/bin/install -c -m 644 ./rewrite.def /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/rewrite.def
/usr/bin/install -c -m 644 ./pos-id.def /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/pos-id.def
/usr/bin/install -c -m 644 ./dicrc /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd/dicrc
make[1]: ディレクトリ '/home/uhfx/mecab-ipadic-neologd/build/mecab-ipadic-2.7.0-20070801-neologd-20200910' から出ます
[install-mecab-ipadic-NEologd] : Install completed.
[install-mecab-ipadic-NEologd] : When you use MeCab, you can set '/usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd' as a value of '-d' option of MeCab.
[install-mecab-ipadic-NEologd] : Usage of mecab-ipadic-NEologd is here.
Usage:
$ mecab -d /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd ...
[install-mecab-ipadic-NEologd] : Finish..
[install-mecab-ipadic-NEologd] : Finish..
mecab -d /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
uhfx@Shuttle-Ubuntu:~$ pip install mecab-python3
Collecting mecab-python3
Downloading mecab_python3-1.0.3-cp38-cp38-manylinux1_x86_64.whl (490 kB)
|████████████████████████████████| 490 kB 5.3 MB/s
Installing collected packages: mecab-python3
WARNING: The scripts mecab-py and mecab-py-info are installed in '/home/uhfx/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed mecab-python3-1.0.3
@Shuttle-Ubuntu:~$ sudo apt install mecab
[sudo] uhfx のパスワード:
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが自動でインストールされましたが、もう必要とされていません:
distro-info libfprint-2-tod1 libllvm10 linux-headers-5.8.0-43-generic
linux-headers-5.8.0-45-generic linux-hwe-5.8-headers-5.8.0-43
linux-hwe-5.8-headers-5.8.0-45 linux-image-5.8.0-43-generic
linux-image-5.8.0-45-generic linux-modules-5.8.0-43-generic
linux-modules-5.8.0-45-generic linux-modules-extra-5.8.0-43-generic
linux-modules-extra-5.8.0-45-generic
これを削除するには 'sudo apt autoremove' を利用してください。
以下の追加パッケージがインストールされます:
libmecab2 mecab-jumandic mecab-jumandic-utf8 mecab-utils
以下のパッケージが新たにインストールされます:
libmecab2 mecab mecab-jumandic mecab-jumandic-utf8 mecab-utils
アップグレード: 0 個、新規インストール: 5 個、削除: 0 個、保留: 1 個。
16.5 MB のアーカイブを取得する必要があります。
この操作後に追加で 219 MB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 libmecab2 amd64 0.996-10build1 [233 kB]
取得:2 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 mecab-utils amd64 0.996-10build1 [4,912 B]
取得:3 http://jp.archive.ubuntu.com/ubuntu focal/universe amd64 mecab-jumandic-utf8 all 7.0-20130310-7 [16.2 MB]
取得:4 http://jp.archive.ubuntu.com/ubuntu focal/universe amd64 mecab-jumandic all 7.0-20130310-7 [2,204 B]
取得:5 http://jp.archive.ubuntu.com/ubuntu focal/universe amd64 mecab amd64 0.996-10build1 [132 kB]
16.5 MB を 1秒 で取得しました (21.8 MB/s)
以前に未選択のパッケージ libmecab2:amd64 を選択しています。
(データベースを読み込んでいます ... 現在 273592 個のファイルとディレクトリがインストールされています。)
.../libmecab2_0.996-10build1_amd64.deb を展開する準備をしています ...
libmecab2:amd64 (0.996-10build1) を展開しています...
以前に未選択のパッケージ mecab-utils を選択しています。
.../mecab-utils_0.996-10build1_amd64.deb を展開する準備をしています ...
mecab-utils (0.996-10build1) を展開しています...
以前に未選択のパッケージ mecab-jumandic-utf8 を選択しています。
.../mecab-jumandic-utf8_7.0-20130310-7_all.deb を展開する準備をしています ...
mecab-jumandic-utf8 (7.0-20130310-7) を展開しています...
以前に未選択のパッケージ mecab-jumandic を選択しています。
.../mecab-jumandic_7.0-20130310-7_all.deb を展開する準備をしています ...
mecab-jumandic (7.0-20130310-7) を展開しています...
以前に未選択のパッケージ mecab を選択しています。
.../mecab_0.996-10build1_amd64.deb を展開する準備をしています ...
mecab (0.996-10build1) を展開しています...
libmecab2:amd64 (0.996-10build1) を設定しています ...
mecab-utils (0.996-10build1) を設定しています ...
mecab-jumandic-utf8 (7.0-20130310-7) を設定しています ...
Compiling Juman dictionary for Mecab.
reading /usr/share/mecab/dic/juman/unk.def ... 37
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/juman/Prefix.csv ... 90
reading /usr/share/mecab/dic/juman/Noun.suusi.csv ... 49
reading /usr/share/mecab/dic/juman/Noun.koyuu.csv ... 7964
reading /usr/share/mecab/dic/juman/Rengo.csv ... 1118
reading /usr/share/mecab/dic/juman/Assert.csv ... 34
reading /usr/share/mecab/dic/juman/Postp.csv ... 108
reading /usr/share/mecab/dic/juman/Noun.keishiki.csv ... 8
reading /usr/share/mecab/dic/juman/Noun.hukusi.csv ... 81
reading /usr/share/mecab/dic/juman/Suffix.csv ... 2128
reading /usr/share/mecab/dic/juman/ContentW.csv ... 551145
reading /usr/share/mecab/dic/juman/Auto.csv ... 18931
reading /usr/share/mecab/dic/juman/AuxV.csv ... 593
reading /usr/share/mecab/dic/juman/Emoticon.csv ... 972
reading /usr/share/mecab/dic/juman/Wikipedia.csv ... 167709
reading /usr/share/mecab/dic/juman/Special.csv ... 158
reading /usr/share/mecab/dic/juman/Demonstrative.csv ... 97
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/juman/matrix.def ... 1876x1876
emitting matrix : 100% |###########################################|
done!
update-alternatives: /var/lib/mecab/dic/debian (mecab-dictionary) を提供するために自動モードで /var/lib/mecab/dic/juman-utf8 を使います
mecab-jumandic (7.0-20130310-7) を設定しています ...
mecab (0.996-10build1) を設定しています ...
man-db (2.9.1-1) のトリガを処理しています ...
libc-bin (2.31-0ubuntu9.2) のトリガを処理しています ...
uhfx@Shuttle-Ubuntu:~$ sudo apt install libmecab-dev
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが自動でインストールされましたが、もう必要とされていません:
distro-info libfprint-2-tod1 libllvm10 linux-headers-5.8.0-43-generic
linux-headers-5.8.0-45-generic linux-hwe-5.8-headers-5.8.0-43
linux-hwe-5.8-headers-5.8.0-45 linux-image-5.8.0-43-generic
linux-image-5.8.0-45-generic linux-modules-5.8.0-43-generic
linux-modules-5.8.0-45-generic linux-modules-extra-5.8.0-43-generic
linux-modules-extra-5.8.0-45-generic
これを削除するには 'sudo apt autoremove' を利用してください。
以下のパッケージが新たにインストールされます:
libmecab-dev
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 1 個。
285 kB のアーカイブを取得する必要があります。
この操作後に追加で 3,112 kB のディスク容量が消費されます。
取得:1 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 libmecab-dev amd64 0.996-10build1 [285 kB]
285 kB を 0秒 で取得しました (1,484 kB/s)
以前に未選択のパッケージ libmecab-dev を選択しています。
(データベースを読み込んでいます ... 現在 273717 個のファイルとディレクトリがインストールされています。)
.../libmecab-dev_0.996-10build1_amd64.deb を展開する準備をしています ...
libmecab-dev (0.996-10build1) を展開しています...
libmecab-dev (0.996-10build1) を設定しています ...
man-db (2.9.1-1) のトリガを処理しています ...
uhfx@Shuttle-Ubuntu:~$ sudo apt install mecab-ipadic-utf8
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが自動でインストールされましたが、もう必要とされていません:
distro-info libfprint-2-tod1 libllvm10 linux-headers-5.8.0-43-generic
linux-headers-5.8.0-45-generic linux-hwe-5.8-headers-5.8.0-43
linux-hwe-5.8-headers-5.8.0-45 linux-image-5.8.0-43-generic
linux-image-5.8.0-45-generic linux-modules-5.8.0-43-generic
linux-modules-5.8.0-45-generic linux-modules-extra-5.8.0-43-generic
linux-modules-extra-5.8.0-45-generic
これを削除するには 'sudo apt autoremove' を利用してください。
以下の追加パッケージがインストールされます:
mecab-ipadic
以下のパッケージが新たにインストールされます:
mecab-ipadic mecab-ipadic-utf8
アップグレード: 0 個、新規インストール: 2 個、削除: 0 個、保留: 1 個。
6,718 kB のアーカイブを取得する必要があります。
この操作後に追加で 54.4 MB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 mecab-ipadic all 2.7.0-20070801+main-2.1 [6,714 kB]
取得:2 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 mecab-ipadic-utf8 all 2.7.0-20070801+main-2.1 [4,380 B]
6,718 kB を 0秒 で取得しました (41.6 MB/s)
以前に未選択のパッケージ mecab-ipadic を選択しています。
(データベースを読み込んでいます ... 現在 273725 個のファイルとディレクトリがインストールされています。)
.../mecab-ipadic_2.7.0-20070801+main-2.1_all.deb を展開する準備をしています ...
mecab-ipadic (2.7.0-20070801+main-2.1) を展開しています...
以前に未選択のパッケージ mecab-ipadic-utf8 を選択しています。
.../mecab-ipadic-utf8_2.7.0-20070801+main-2.1_all.deb を展開する準備をしています ...
mecab-ipadic-utf8 (2.7.0-20070801+main-2.1) を展開しています...
mecab-ipadic (2.7.0-20070801+main-2.1) を設定しています ...
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
update-alternatives: /var/lib/mecab/dic/debian (mecab-dictionary) を提供するために自動モードで /var/lib/mecab/dic/ipadic を使います
mecab-ipadic-utf8 (2.7.0-20070801+main-2.1) を設定しています ...
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
update-alternatives: /var/lib/mecab/dic/debian (mecab-dictionary) を提供するために自動モードで /var/lib/mecab/dic/ipadic-utf8 を使います
uhfx@Shuttle-Ubuntu:/etc$ sudo nano mecabrc
GNU nano 4.8 mecabrc 変更済み
;
; Configuration file of MeCab
;
; $Id: mecabrc.in,v 1.3 2006/05/29 15:36:08 taku-ku Exp $;
;
;dicdir = /var/lib/mecab/dic/debian
dicdir = /usr/lib/x86_64-linux-gnu/mecab/dic/mecab-ipadic-neologd
; userdic = /home/foo/bar/user.dic
userdic = /usr/local/lib/mecab/dic/userdic/foo.dic
; output-format-type = wakati
; input-buffer-size = 8192
; node-format = %m\n
; bos-format = %S\n
; eos-format = EOS\n
uhfx@Shuttle-Ubuntu:/etc$ echo "ユニパが開けない" | mecab
ユニパ 名詞,固有名詞,一般,*,*,*,ユニバーサルパスポート,ユニパ,ユニパ
が 助詞,格助詞,一般,*,*,*,が,ガ,ガ
開け 動詞,自立,*,*,一段,未然形,開ける,アケ,アケ
ない 助動詞,*,*,*,特殊・ナイ,基本形,ない,ナイ,ナイ
EOS
(bachelor) uhfx@Shuttle-Ubuntu:~/bachelor/bachelor$ python3 test2.py vpn
Failed initializing MeCab. Please see the README for possible solutions:
https://github.com/SamuraiT/mecab-python3#common-issues
If you are still having trouble, please file an issue here, and include the
ERROR DETAILS below:
https://github.com/SamuraiT/mecab-python3/issues
issueを英語で書く必要はありません。
------------------- ERROR DETAILS ------------------------
arguments: -Ochasen
error message: [ifs] no such file or directory: /usr/local/etc/mecabrc
----------------------------------------------------------
Traceback (most recent call last):
File "test2.py", line 16, in <module>
tagger = MeCab.Tagger("-Ochasen")
File "/home/uhfx/.local/lib/python3.8/site-packages/MeCab/__init__.py", line 124, in __init__
super(Tagger, self).__init__(args)
RuntimeError
(bachelor) uhfx@Shuttle-Ubuntu:~/bachelor/bachelor$ sudo ln -s /etc/mecabrc /usr/local/etc/mecabrc
[sudo] uhfx のパスワード:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment