Code Monkey home page Code Monkey logo

okurawebapi's Introduction

OkuraWebAPI Build Status Coverage Status

これは何

todeskingさんが作成され たRubyによる形態素解析ライブラリ okuraをHTTP経由で利用す るための簡易ラッパーです。

準備

  • 1: gem をインストールします。
% bundle install --path vendor/bundle
% bundle exec rake prepare_dict
  • 3: 任意の rack コンテナでアプリを起動します。
% bundle exec rackup

形態素解析

  • 1: URL /okura/morph に対し、HTTP POST で形態素解析したい文を 送出します。formatはJSON、文を示すkeyは'text'です。
% curl -d '{"text": "今日は良い天気でした。"}' http://localhost:9292/okura/morph -H Content-Type:application/json
  • 2: 解析結果のmincost_pathが配列としてJSONで返ります。各要素はHashです。各keyとdataの対応付けは以下の通りです。

    • surface: 表記。node.word.surface。
    • text: 品詞の配列。node.left.text。
[{"surface":"BOS/EOS","text":"[\"BOS/EOS\"]"},{"surface":"今日","text":"[\"名詞\", \"副詞可能\", \"*\", \"*\", \"*\", \"*\", \"*\"]"},{"surface":"は","text":"[\"助詞\", \"係助詞\", \"*\", \"*\", \"*\", \"*\", \"は\"]"},{"surface":"良い","text":"[\"形容詞\", \"自立\", \"*\", \"*\", \"形容詞・アウオ段\", \"基本形\", \"*\"]"},{"surface":"天気","text":"[\"名詞\", \"一般\", \"*\", \"*\", \"*\", \"*\", \"*\"]"},{"surface":"でし","text":"[\"助動詞\", \"*\", \"*\", \"*\", \"特殊・デス\", \"連用形\", \"です\"]"},{"surface":"た","text":"[\"助動詞\", \"*\", \"*\", \"*\", \"特殊・タ\", \"基本形\", \"た\"]"},{"surface":"。","text":"[\"記号\", \"句点\", \"*\", \"*\", \"*\", \"*\", \"BOS/EOS\"]"},{"surface":"BOS/EOS","text":"[\"BOS/EOS\"]"}]

分かち書き

  • 1: URL /okura/wakati に対し、HTTP POST で形態素解析したい文を 送出します。formatはJSON、文を示すkeyは'text'です。
% curl -d '{"text": "今日は良い天気でした。"}' http://localhost:9292/okura/wakati -H Content-Type:application/json
  • 2: 分かち書き結果が配列としてJSONで返ります。
["BOS/EOS","今日","は","良い","天気","でし","た","。","BOS/EOS"]

謝辞

有益なライブラリを公開して下さった todesking さんへ感謝いたします。

COPYRIGHT

  • mecab-naist-jdic-0.6.3b-20111013.tar.gz ならびに okura は それぞれのライセンスをご確認下さい。
  • 本レポジトリ内コードは MIT License です。詳細は LICENSE を御覧ください。

okurawebapi's People

Contributors

n-miyo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.