Add filters to JBJ.
With npm do:
$ npm install jbj-nlp
var JBJ = require('jbj');
JBJ.use(require('jbj-nlp'));Anglicize a string
var stylesheet = {
"set": "ÂÇİĞÖŞÜÑ âçığöşüñ",
"anglicize": true
};
JBJ.render(stylesheet, console.log);
// ACIGOSUN acigosunCount characters. Options:
true: all characters, including white spacesslug: alphanumeric charactersregex: characters matching the regex
var stylesheet = {
"set": "L'arbre de Jean-Claude est tombé.",
"countCharacters" : true
};
JBJ.render(stylesheet, console.log);
// 33Count tokenized words
var stylesheet = {
"set": "L'arbre de Jean-Claude est tombé.",
"countWords" : true
};
JBJ.render(stylesheet, console.log);
// 6Tokenise a string.Options:
true: split on white spaces and ponctuation, keep dashes and quotesslug: split on non-alphanumeric charactersregex: split with the given regex
var stylesheet = {
"set": "L'arbre de Jean-Claude est tombé.",
"tokenize" : true
};
JBJ.render(stylesheet, console.log);
// ["L'","arbre","de","Jean-Claude","est","tombé"]Gives a phonetics approximate to the input string.
var stylesheet = {
"set": "Psychologue",
"metaphone" : true
};
JBJ.render(stylesheet, console.log);
// PSXLK