Ajatt-Tools / mecab_controller

🍣 Mecab wrapper to generate furigana readings.
https://tatsumoto.neocities.org/blog/join-our-community.html
GNU Affero General Public License v3.0
12 stars 3 forks source link

Add ipadic paths for macOS if installed via Homebrew on Apple silicon #5

Closed elmimmo closed 10 months ago

elmimmo commented 10 months ago

The path for ipadic if installed via brew install mecab-ipadic in the code is correct only for Intel-based Macs. On Apple silicon, that would default to /opt/homebrew/lib/mecab/dic/ipadic/.

Likewise, if mecab itself had been installed via brew install mecab, subsequently installing mecab-ipadic-neologd by following its install instructions (since as of today there is no Homebrew formula to install it with brew) will leave the dictionary installed at:

neither of which are contemplated in the code.

tatsumoto-ren commented 10 months ago

The additional path was added in #4. Apparently, the author didn't know that other locations are possible.

Is it okay if I simply append the following to the list?

/opt/homebrew/lib/mecab/dic/mecab-ipadic-neologd/
/opt/homebrew/lib/mecab/dic/ipadic/
/usr/local/lib/mecab/dic/mecab-ipadic/
elmimmo commented 10 months ago

I presume that would indeed be OK, but I made a mistake in one of the paths and edited the issue to correct it after your reply. The three extra paths should be:

/usr/local/lib/mecab/dic/mecab-ipadic-neologd
/opt/homebrew/lib/mecab/dic/ipadic
/opt/homebrew/lib/mecab/dic/mecab-ipadic-neologd