parse-japanese
A Japanese language parser producing NLCST
nodes.
- For semantics of nodes, see NLCST;
Installation
npm:
npm install parse-japanese
Usage
var inspect = require('unist-util-inspect')
var ParseJapanese = require('parse-japanese')
var japanese = new ParseJapanese()
var text = '1 これは前段です。これは中段(2文の場合は後段。)です。これは後段です。\n'
japanese.parse(text, (cst) => {
console.log(inspect(cst))
})
japanese = new ParseJapanese({pos: true})
text = 'すもももももももものうち。'
japanese.parse(text, (cst) => {
console.log(inspect(cst))
})
API
ParseJapanese(options?)
Exposes the functionality needed to tokenize natural Japanese languages into a syntax tree.
Parameters:
ParseJapanese#parse(value, cb)
Tokenize natural Japanese languages into an NLCST.
Parameters:
function cb(cst)
Callback invoked when the output is generated with the processed document.
Parameters:
cst
(string
) — Generated document;
Related
License
MIT