2.0.1 • Published 10 years ago
scuttlezanetti v2.0.1
ScuttleZanetti
CLI and node.js library to access and remove stop words
Examples
CLI
npm install -g scuttlezanetti
> echo "this is a test" | scuttlezanetti
test
> echo "this is a test" | scuttlezanetti --stop-words test,is
this a
> echo "this,is,a,test" | scuttlezanetti --tokenize-pattern '\W+'
test
Preserve lines in file
while read CMD; do
echo "$CMD" | scuttlezanetti && echo
done < "./input" > output
Node.js
npm install scuttlezanetti
var ScuttleZanetti = require( 'scuttlezanetti' ).api;
var stopWords = require( 'scuttlezanetti' ).stopWords;
var sz = = new ScuttleZanetti( {
stopWords: stopWords, //default
tokenizePattern: undefined, //default
tokenizeMethod: function( s ) {
return s.replace(/[^\w\s-]/, "").split( " " );
} //default
} );
sz.tokenize( "this is a test" ); //[ 'this', 'is', 'a', 'test' ]
sz.removeStopWords( "this is a test" ); //'test'