No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Latest commit 522d1e5 Jan 18, 2013 @fpaula Update .travis.yml
Permalink
Failed to load latest commit information.
test
.travis.yml
README.md
TODO
package.json
text_parser.js

README.md

Travis

parse(text, args)

Args dictionary (array) order (asc|desc) order_by (word|hits)

Simple usage

var t = require('text_parser'); t.parse("Simple, simple text!"); // => [{'word':'simple', 'hits':2}, {'word':'text', 'hits':1}]

Dictionary

var t = require('text_parser'); var args = {dictionary: ['this', 'test']} t.parse("This is a test with a dictionary. Nice test!", args); // => [{'word':'this', 'hits':1}, {'word':'test', 'hits':2}]

Ordering

var t = require('text_parser'); var args = {order: 'asc', order_by: 'word'} t.parse("Banana Apple", args); // => [{'word':'apple', 'hits':1}, {'word':'banana', 'hits':1}]

var t = require('text_parser'); var args = {order: 'desc', order_by: 'hits'} t.parse("Apple Banana Banana", args); // => [{'word':'banana', 'hits':2}, {'word':'apple', 'hits':1}]