nlcst-to-textom
Transform an NLCST node into a TextOM node.
Installation
npm:
$ npm install nlcst-to-textom
Component.js:
$ component install wooorm/nlcst-to-textom
Bower:
$ bower install nlcst-to-textom
Duo:
var nlcstToTextOM = require('wooorm/nlcst-to-textom');
Usage
var TextOMConstructor,
nlcstToTextOM,
inspect,
TextOM;
TextOMConstructor = require('textom');
nlcstToTextOM = require('nlcst-to-textom');
inspect = require('retext-inspect');
TextOM = new TextOMConstructor();
inspect({
'TextOM' : TextOM
}, {});
console.log(nlcstToTextOM(TextOM, {
"type": "WordNode",
"data": {
"partOfSpeech": [
"NNP",
"NN"
]
},
"children": [
{
"type": "TextNode",
"value": "AT"
},
{
"type": "PunctuationNode",
"value": "&"
},
{
"type": "TextNode",
"value": "T"
}
]
}));
Related
License
MIT © Titus Wormer