もはだな|MeCab APIについて

形態素解析のAPIについて

注意事項

本サービスは個人的な実験サービスです。
APIのご利用は基本的にどなたでもご利用が可能ですが、アクセス頻度は少なめでおねがいします。
サービスに悪影響を及ぼす場合は予告なしに対策を取らせていただきます。
また、注意事項は予告なしに変更する可能性があります。
ライセンスはMecab、IPA Dicを利用していますのでこれに従います。
上記に従う限りご自身の責任の範囲内でご自由にどうぞ。

APIs

parse

テキストを分かち書きします

Method: Get
URL: /api/<api version>/parse
現在のapi versionはv1です
パラメータ
sentence: 対象のテキストです。長過ぎるとエラーになります
complex: complexが存在すると複合名詞を推測します
レスポンス
JSONです
status: ステータスIDです。Http statusライクです
message: "Success"/"Faild"
results: mecabの結果です

Demo

parse(複合名詞なし)

$ curl -G https://mohadana.herokuapp.com/api/v1/parse --data-urlencode sentence="日本語の形態素解析"|jq
{
  "status": 200,
  "message": "Success",
  "results": [
    {
      "surface": "日本語",
      "reading": "ニホンゴ",
      "pronunciation": "ニホンゴ",
      "pos": "名詞",
      "pos_detail": [
        "一般"
      ],
      "conjugated_form": null,
      "conjugated_type": null,
      "infinitive": "日本語"
    },
    {
      "surface": "の",
      "reading": "ノ",
      "pronunciation": "ノ",
      "pos": "助詞",
      "pos_detail": [
        "連体化"
      ],
      "conjugated_form": null,
      "conjugated_type": null,
      "infinitive": "の"
    },
    {
      "surface": "形態素",
      "reading": "ケイタイソ",
      "pronunciation": "ケイタイソ",
      "pos": "名詞",
      "pos_detail": [
        "一般"
      ],
      "conjugated_form": null,
      "conjugated_type": null,
      "infinitive": "形態素"
    },
    {
      "surface": "解析",
      "reading": "カイセキ",
      "pronunciation": "カイセキ",
      "pos": "名詞",
      "pos_detail": [
        "サ変接続"
      ],
      "conjugated_form": null,
      "conjugated_type": null,
      "infinitive": "解析"
    }
  ]
}

parse(複合名詞あり)

$ curl -G https://mohadana.herokuapp.com/api/v1/parse --data-urlencode sentence="日本語の形態素解析" -d complex|jq
{
  "status": 200,
  "message": "Success",
  "results": [
    {
      "surface": "日本語",
      "reading": "ニホンゴ",
      "pronunciation": "ニホンゴ",
      "pos": "名詞",
      "pos_detail": [
        "一般"
      ],
      "conjugated_form": null,
      "conjugated_type": null,
      "infinitive": "日本語"
    },
    {
      "surface": "の",
      "reading": "ノ",
      "pronunciation": "ノ",
      "pos": "助詞",
      "pos_detail": [
        "連体化"
      ],
      "conjugated_form": null,
      "conjugated_type": null,
      "infinitive": "の"
    },
    {
      "surface": "形態素解析",
      "reading": "ケイタイソカイセキ",
      "pronunciation": "ケイタイソカイセキ",
      "pos": "名詞",
      "pos_detail": [
        "複合"
      ],
      "conjugated_form": "",
      "conjugated_type": null,
      "infinitive": null
    }
  ]
}