yahoo-jlp

0.2.0-alpha • Public • Published

node-yahoo-jlp

Build Status Coverage Status Dependency Status

Node.js module for Yahoo! JAPAN jlp api. (http://developer.yahoo.co.jp/webapi/jlp/)

Installation

You can install via npm:

npm install yahoo-jlp

Usage:

var Yahoojlp = require('yahoo-jlp');

// set appid
var yjlp = new Yahoojlp('your_app_id');

// parse
yjlp.parse('日本語文を形態素に分割します。', function (err, response, data) {
  console.log(data);
});

// convert
yjlp.convert('ひらがなをかんじにへんかんします。', function (err, response, data) {
  console.log(data);
});

// ruby
yjlp.ruby('漢字かな交じり文にふりがなを付けます。', function (err, response, data) {
  console.log(data);
});

// proofreading
yjlp.check('日本語文の校正をします。', function (err, response, data) {
  console.log(data);
});

// check dependency relations
yjlp.relation('日本語文の係り受け関係を解析します。', function (err, response, data) {
  console.log(data);
});

// extract key phrase
yjlp.keyphrase('日本語文から特徴的な表現を抽出します。', function (err, response, data) {
  console.log(data);
});

Documentation

Yahoojlp(appid)

Create yjlp instance.

  • appid String your application ID provided by Yahoo! JAPAN.

yjlp.parse(params, callback)

Parse Japanese to morpheme. (http://developer.yahoo.co.jp/webapi/jlp/ma/v1/parse.html)

  • params Object|String allowed parameters. String must be sentence to parse.
  • callback Function callback function.

params

  • sentence String sentense to parse.
  • results Array|String ma, uniq.
  • response Array|String surface, reading, pos, baseform, feature.
  • filter Array|Number 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.
  • ma_response Array|String overwrite response when result has ma.
  • ma_filter Array|String overwrite filter when result has ma.
  • uniq_response Array|String overwrite response when result has uniq.
  • uniq_filter Array|String overwrite filter when result has uniq.
  • uniq_by_baseform Boolean|String true.

yjlp.convert(params, callback)

Convert Japanese from hiragana to kanji. (http://developer.yahoo.co.jp/webapi/jlp/jim/v1/conversion.html)

  • params Object|String allowed parameters. String must be sentence to parse.
  • callback Function callback function.

params

  • sentence String sentense to parse. MAX length is 80.
  • format String roman.
  • mode String normal, roman, predictive.
  • response Array|String katakana, hiragana, alphanumeric, half_katakana, half_alphanumeric.
  • dictionary Array|String default, name, place, zip, symbol.
  • results Number integer, MAX is 999

yjlp.ruby(params, callback)

Put ruby to kanji. (http://developer.yahoo.co.jp/webapi/jlp/furigana/v1/furigana.html)

  • params Object|String allowed parameters. String must be sentence to parse.
  • callback Function callback function.

params

  • sentence String sentense to parse.
  • grade Number 1, 2, 3, 4, 5, 6, 7, 8.

yjlp.check(params, callback)

Proofread Japanese. (http://developer.yahoo.co.jp/webapi/jlp/kousei/v1/kousei.html)

  • params Object|String allowed parameters. String must be sentence to parse.
  • callback Function callback function.

params

  • sentence String sentense to parse.
  • filter_group Array|Number 1, 2, 3.
  • no_filter Array|Number 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17.

yjlp.proofread(params, callback)

Synonym of yjlp.check.

yjlp.relation(sentence, callback)

Check dependency relations of Japanese. (http://developer.yahoo.co.jp/webapi/jlp/da/v1/parse.html)

  • sentence String sentense to parse. One sentence.
  • callback Function callback function.

yjlp.keyphrase(sentence, callback)

Extract key phrase from Japanese. (http://developer.yahoo.co.jp/webapi/jlp/keyphrase/v1/extract.html)

  • sentence String sentense to parse.
  • callback Function callback function.

callback

Callback function argument will be (err, response, data).

  • err Object
  • response Object
  • data Object

License

MIT license

Readme

Keywords

Package Sidebar

Install

npm i yahoo-jlp

Weekly Downloads

0

Version

0.2.0-alpha

License

MIT

Last publish

Collaborators

  • egy186