nlcst-normalize
Normalize a word for easier comparison, useful for NLCST
Installation
npm:
npm install nlcst-normalize
nlcst-normalize is also available for duo, and as an
AMD, CommonJS, and globals module, uncompressed and compressed.
Usage
var normalize = require('nlcst-normalize');
normalize('Don’t');
normalize('Don\'t');
normalize('Block-level');
normalize({
'type': 'WordNode',
'children': [
{
'type': 'TextNode',
'value': 'Block'
},
{
'type': 'PunctuationNode',
'value': '-'
},
{
'type': 'TextNode',
'value': 'level'
}
]
});
API
normalize(value)
Quote a value.
Parameters
value
(Node
, Array.<Node>
, or string
)
— Value to normalize.
Returns: string
— Normalized value.
License
MIT © Titus Wormer