テストコードにおおまかな使い方は出ていませんでしょうか?
HaskellでMecabを用いて形態素解析をしたい。
環境: WSL:Ubuntu, stack, Mecab
$ sudo apt install mecab libmecab-dev mecab-ipadic-utf8
を実行しmecabをインストール。
2.$ git clone —depth 1 https://github.com/neologd/mecab-ipadic-neologd.git
$ cd mecab-ipadic-neologd
$ bin/install-mecab-ipadic-neologd -n -a
を実行しNEologdをインストール
3./etc/Mecabrcのmecab設定ファイルのdicdirの行をNEologdのパスに書き換え
4.yesodプロジェクトディレクトリのstack.yamlに
extra-deps:
- mecab-0.4.0
を追加
5.プロジェクトのソースファイルにimport qualified NLP.Mecab as Mecab
と入力した
6.コンパイル時にCould not find module ‘NLP.Mecab’
のエラーが出てコンパイルに失敗
Could not find module ‘NLP.Mecab’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
10 | import qualified NLP.Mecab as Mecab
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Completed 196 action(s).
Error: [S-7282]
Stack failed to execute the build plan.
While executing the build plan, Stack encountered the error:
[S-7011]
While building package my-app-0.0.0 (scroll up to its section to see the error) using:
/home/vashli/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_6HauvNHV_3.6.3.0_ghc-9.2.8 --verbose=1 --builddir=.stack-work/dist/x86_64-linux-tinfo6/ghc-9.2.8 build lib:my-app exe:my-app --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Mecabのバージョンを0.4.0としたのはUbuntuに0.4.0ならあるよーみたいに言われたからでMecabのバージョンなどの正確な内容が把握できてません。import文までのコンパイル(ほぼすべて)は問題なくできました。
HaskellとMecabに関する情報が少なすぎて何もわかりません。。。
どなたかご教授お願いします。
テストコードにおおまかな使い方は出ていませんでしょうか?
@xxxkousukexxx03
Questioner回答ありがとうございます!
どうやら古い情報のようでそもそもyesodのテンプレートから異なっているので再現できませんでした、、、
mecabを別のファイルに管理する感じも今はほとんどしない?(よくわからない)っぽいです。