yahoo-jlp
v0.2.0-alpha
Published
Node.js module for Yahoo! JAPAN jlp api
Downloads
4
Readme
node-yahoo-jlp
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 besentence
to parse.callback
Function callback function.
params
sentence
String sentense to parse.results
Array|Stringma
,uniq
.response
Array|Stringsurface
,reading
,pos
,baseform
,feature
.filter
Array|Number1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,13
.ma_response
Array|String overwriteresponse
whenresult
hasma
.ma_filter
Array|String overwritefilter
whenresult
hasma
.uniq_response
Array|String overwriteresponse
whenresult
hasuniq
.uniq_filter
Array|String overwritefilter
whenresult
hasuniq
.uniq_by_baseform
Boolean|Stringtrue
.
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 besentence
to parse.callback
Function callback function.
params
sentence
String sentense to parse. MAX length is80
.format
Stringroman
.mode
Stringnormal
,roman
,predictive
.response
Array|Stringkatakana
,hiragana
,alphanumeric
,half_katakana
,half_alphanumeric
.dictionary
Array|Stringdefault
,name
,place
,zip
,symbol
.results
Number integer, MAX is999
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 besentence
to parse.callback
Function callback function.
params
sentence
String sentense to parse.grade
Number1
,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 besentence
to parse.callback
Function callback function.
params
sentence
String sentense to parse.filter_group
Array|Number1
,2
,3
.no_filter
Array|Number1
,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
Objectresponse
Objectdata
Object