neologd / mecab-ipadic-neologd

Neologism dictionary based on the language resources on the Web for mecab-ipadic
Other
2.7k stars 288 forks source link

Fix error in installing into a missing directory #62

Closed pecorarista closed 4 years ago

pecorarista commented 4 years ago

What is this PR for?

This PR fixes an error in installing mecab-ipadic-NEologd into a missing directory.

This PR includes

What type of PR is it?

Bugfix

What is the issue?

The following error sometimes occurs:

ls: cannot access '/usr/lib/x86_64-linux-gnu/mecab/dic': No such file or directory
/mecab-ipadic-neologd/bin/../libexec/install-mecab-ipadic-neologd.sh: line 56: [: 0: unary operator expected

This happens when a user install mecab and mecab-ipadic-utf8 on Ubuntu by apt. The package manager installs the dictionaries into /var/lib/mecab/dic. However, the default location for dictionaries, indicated by mecab-config --dicdir, is set to /usr/lib/x86_64-linux-gnu/mecab/dic, which has not been created. Thus, installation script fails in running ls. This error is not critical because the following processes run successfully even when it happens. Possibly, this is a bug of MeCab or the package manager, but it is safer to check if the directory exist.

How should this be tested?

Create a new Ubuntu machine and install mecab and mecab-ipadic-utf8. Then, install mecab-ipadic-NEologd without editing mecabrc.

neologd commented 4 years ago

Thank you for nice work. It's clear that your PR has no disadvantage. Thank you !!