mecabを実行して結果を返すだけのサーバー
- mecab と mecab-ipadic-NEologd などを入れる
https://github.com/neologd/mecab-ipadic-neologd/blob/master/README.ja.md config.example.yml
をconfig.yml
としてコピーしてパス等を変えるyarn install && yarn build
PORT=3062 yarn start
またはDockerを使う場合
cp config.example.yml config.yml
docker-compose build
docker-compose up -d
GET http://localhost:3062/?text=魔法少女リリカルなのはなのはなぜなのはてな
か
POST http://localhost:3062/
{
"text": "魔法少女リリカルなのはなのはなぜなのはてな"
}
{
"result":[
["魔法少女リリカルなのは","名詞","固有名詞","一般","*","*","*","魔法少女リリカルなのは","マホウショウジョリリカルナノハ","マホーショージョリリカルナノハ"],
["な","助動詞","*","*","*","特殊・ダ","体言接続","だ","ナ","ナ"],
["の","名詞","非自立","一般","*","*","*","の","ノ","ノ"],
["は","助詞","係助詞","*","*","*","*","は","ハ","ワ"],
["なぜ","副詞","助詞類接続","*","*","*","*","なぜ","ナゼ","ナゼ"],
["な","助動詞","*","*","*","特殊・ダ","体言接続","だ","ナ","ナ"],
["の","名詞","非自立","一般","*","*","*","の","ノ","ノ"],
["はてな","感動詞","*","*","*","*","*","はてな","ハテナ","ハテナ"]
]
}