Transform an NLCST node into a string.
npm:
npm install nlcst-to-stringnlcst-to-string is also available for bower, component, and duo, and as an AMD, CommonJS, and globals module, uncompressed and compressed.
var nlcstToString = require('nlcst-to-string');
console.log(nlcstToString({
"type": "WordNode",
"data": {
"partOfSpeech": [
"NNP",
"NN"
]
},
"children": [
{
"type": "TextNode",
"value": "AT"
},
{
"type": "PunctuationNode",
"value": "&"
},
{
"type": "TextNode",
"value": "T"
}
]
}));Yields:
AT&T
Stringify an NLCST node (or an array of NLCST nodes).
Signatures
toString(node);toString(nodes).
Parameters
-
node(NLCSTNode) — Node to to stringify. -
nodes(Array.<NLCSTNode>) — Nodes to to stringify.
Returns
string — Stringified node / nodes.