Giter Club home page Giter Club logo

mecabaas's Introduction

概要

日本語文章を形態素解析し、その結果を返してくれるAPIを実装するアプリです。node.jsで稼働します。 下記のようなGETリクエストを投げるだけで形態素解析された結果を返してくれます。

http://mecab.oracle.tokyo/api/parse?text=ハンバーグを食べました。 

形態素解析にはmecabを利用します。辞書としてmecab-ipadic-NEologdもしくは通常のIPA辞書を利用できます。

環境要件

  • node.js
  • mecab, IPA辞書, mecab-ipadic-NEologdがインストールされていること。(mecab-ipadic-NElogdはなくても動きます。その場合、下記インストール手順の中でmecab-asyncモジュールを修正せずそのまま使ってください)

インストール方法

$ git clone https://github.com/nkjm/mecabaas.git
$ npm install

mecab-asyncモジュールをmecab-ipadic-NEologdを使うように修正する。

$ vi node_modules/mecab-async/mecab.js
// for backward compatibility
var MeCab = function() {};

MeCab.prototype = {
    command : 'mecab -d ' + process.env.MECAB_IPADIC_NELOGD_PATH,

実行

// mecab-ipadic-neologdへのパスは自身の環境の値に置き換えてください。
MECAB_IPADIC_NEOLOGD_PATH=/usr/local/mecab/lib/mecab/dic/mecab-ipadic-neologd npm start

APIへのアクセス

解析

  • http[s]://YOUR_HOST_NAME/api/parse?text=分析したいテキスト

わかち書き

  • http[s]://YOUR_HOST_NAME/api/wakachi?text=分析したいテキスト

Demo

mecabaas's People

Contributors

nkjm avatar

Stargazers

 avatar

Watchers

 avatar  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.