diff --git a/README.md b/README.md index 211b4a6..2f146b4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,18 @@ wordpos wordpos is a set of part-of-speech (POS) utilities for Node.js using [natural's](http://github.com/NaturalNode/natural) WordNet module. -*Update*: get random word(s). +*Update*: get [random](#randx) word(s). + +## Installation + + npm install -g wordpos + +To run spec: + + npm install -g jasmine-node + cd spec + jasmine-node wordpos_spec.js --verbose + jasmine-node validate_spec.js --verbose ## Quick usage Command-line: @@ -41,19 +52,6 @@ wordpos.isAdjective('awesome', function(result){ See `wordpos_spec.js` for full usage. -## Installation - - npm install wordpos - -Note: `wordpos-bench.js` requires a [forked uubench](https://github.com/moos/uubench) module. To use the CLI (see below), install globally with the `-g` option. - -To run spec: - - npm install jasmine-node -g - cd spec - jasmine-node wordpos_spec.js --verbose - jasmine-node validate_spec.js --verbose - ### Options ```js @@ -299,45 +297,14 @@ See blog article [Optimizing WordPos](http://blog.42at.com/optimizing-wordpos). ## Command-line: CLI -Usage: -```bash -$ wordpos +For CLI usage and examples, see [bin/README](bin). - Usage: wordpos [options] [word ... | -i | ] - - Commands: - - get get list of words for particular POS - - def lookup definitions - - rand get random words (optionally starting with 'word' ...) - - parse show parsed words, deduped and less stopwords - - stopwords show list of stopwords (valid options are -b and -j) - - Options: - - -h, --help output usage information - -V, --version output the version number - -n, --noun Get nouns - -a, --adj Get adjectives - -v, --verb Get verbs - -r, --adv Get adverbs - -c, --count get counts only (noun, adj, verb, adv, total parsed words) - -b, --brief brief output (all on one line, no headers) - -f, --full full results object - -j, --json full results object as JSON - -i, --file input file - -s, --withStopwords include stopwords (default: stopwords are excluded) - -N, --num number of random words to get -``` - -For CLI examples, see [bin/README](bin/README.md). ## Benchmark +Note: `wordpos-bench.js` requires a [forked uubench](../uubench) module. + + cd bench node wordpos-bench.js diff --git a/bin/README.md b/bin/README.md index e039650..c2724a4 100644 --- a/bin/README.md +++ b/bin/README.md @@ -4,7 +4,9 @@ wordpos ## Command-line: CLI Version 0.1.6 introduces the command-line interface (./bin/wordpos-cli.js), available as 'wordpos' if installed globally -"npm install wordpos -g", otherwise as 'node_modules/.bin/wordpos' if installed without the -g. +`npm install -g wordpos`, otherwise as `node_modules/.bin/wordpos` if installed without the -g. + +### Examples: ```bash $ wordpos get The angry bear chased the frightened little squirrel @@ -104,7 +106,7 @@ about after all also am an and another any are as at be because ... ```bash $ wordpos - Usage: wordpos-cli.js [options] [word ... | -i | ] + Usage: wordpos [options] [word ... | -i | ] Commands: @@ -128,8 +130,8 @@ $ wordpos -r, --adv Get adverbs -c, --count get counts only (noun, adj, verb, adv, total parsed words) -b, --brief brief output (all on one line, no headers) - -f, --full full results object - -j, --json full results object as JSON + -f, --full full result object + -j, --json full result object as JSON -i, --file input file -s, --withStopwords include stopwords (default: stopwords are excluded) -N, --num number of random words to get diff --git a/bin/wordpos-cli.js b/bin/wordpos-cli.js index c02fba5..7a3d140 100644 --- a/bin/wordpos-cli.js +++ b/bin/wordpos-cli.js @@ -22,7 +22,7 @@ var program = require('commander'), program .version(version) - .usage('[options] [word ... | -i | ]') + .usage(' [options] [word ... | -i | ]') .option('-n, --noun', 'Get nouns') .option('-a, --adj', 'Get adjectives') diff --git a/spec/validate_spec.js b/spec/validate_spec.js index 5c01a16..de178c2 100644 --- a/spec/validate_spec.js +++ b/spec/validate_spec.js @@ -16,6 +16,11 @@ var exec = require('child_process').exec, cmd = 'node ' + __dirname + '/../tools/validate '; + +// increase timeout +jasmine.asyncSpecWait.timeout = 20 * 1000; + + describe('validate isX() using fastIndex', function() { it('should validate index.noun', function() {