fixed Jasmine timeout, update readmes.
This commit is contained in:
parent
cb884d2dfa
commit
0d1f201bde
65
README.md
65
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.
|
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
|
## Quick usage
|
||||||
Command-line:
|
Command-line:
|
||||||
|
@ -41,19 +52,6 @@ wordpos.isAdjective('awesome', function(result){
|
||||||
|
|
||||||
See `wordpos_spec.js` for full usage.
|
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
|
### Options
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -299,45 +297,14 @@ See blog article [Optimizing WordPos](http://blog.42at.com/optimizing-wordpos).
|
||||||
|
|
||||||
## Command-line: CLI
|
## Command-line: CLI
|
||||||
|
|
||||||
Usage:
|
For CLI usage and examples, see [bin/README](bin).
|
||||||
```bash
|
|
||||||
$ wordpos
|
|
||||||
|
|
||||||
Usage: wordpos [options] <command> [word ... | -i <file> | <stdin>]
|
|
||||||
|
|
||||||
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 <file> input file
|
|
||||||
-s, --withStopwords include stopwords (default: stopwords are excluded)
|
|
||||||
-N, --num <num> number of random words to get
|
|
||||||
```
|
|
||||||
|
|
||||||
For CLI examples, see [bin/README](bin/README.md).
|
|
||||||
|
|
||||||
## Benchmark
|
## Benchmark
|
||||||
|
|
||||||
|
Note: `wordpos-bench.js` requires a [forked uubench](../uubench) module.
|
||||||
|
|
||||||
|
cd bench
|
||||||
node wordpos-bench.js
|
node wordpos-bench.js
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,9 @@ wordpos
|
||||||
## Command-line: CLI
|
## Command-line: CLI
|
||||||
|
|
||||||
Version 0.1.6 introduces the command-line interface (./bin/wordpos-cli.js), available as 'wordpos' if installed globally
|
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
|
```bash
|
||||||
$ wordpos get The angry bear chased the frightened little squirrel
|
$ 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
|
```bash
|
||||||
$ wordpos
|
$ wordpos
|
||||||
|
|
||||||
Usage: wordpos-cli.js [options] <command> [word ... | -i <file> | <stdin>]
|
Usage: wordpos <command> [options] [word ... | -i <file> | <stdin>]
|
||||||
|
|
||||||
Commands:
|
Commands:
|
||||||
|
|
||||||
|
@ -128,8 +130,8 @@ $ wordpos
|
||||||
-r, --adv Get adverbs
|
-r, --adv Get adverbs
|
||||||
-c, --count get counts only (noun, adj, verb, adv, total parsed words)
|
-c, --count get counts only (noun, adj, verb, adv, total parsed words)
|
||||||
-b, --brief brief output (all on one line, no headers)
|
-b, --brief brief output (all on one line, no headers)
|
||||||
-f, --full full results object
|
-f, --full full result object
|
||||||
-j, --json full results object as JSON
|
-j, --json full result object as JSON
|
||||||
-i, --file <file> input file
|
-i, --file <file> input file
|
||||||
-s, --withStopwords include stopwords (default: stopwords are excluded)
|
-s, --withStopwords include stopwords (default: stopwords are excluded)
|
||||||
-N, --num <num> number of random words to get
|
-N, --num <num> number of random words to get
|
||||||
|
|
|
@ -22,7 +22,7 @@ var program = require('commander'),
|
||||||
|
|
||||||
program
|
program
|
||||||
.version(version)
|
.version(version)
|
||||||
.usage('[options] <command> [word ... | -i <file> | <stdin>]')
|
.usage('<command> [options] [word ... | -i <file> | <stdin>]')
|
||||||
|
|
||||||
.option('-n, --noun', 'Get nouns')
|
.option('-n, --noun', 'Get nouns')
|
||||||
.option('-a, --adj', 'Get adjectives')
|
.option('-a, --adj', 'Get adjectives')
|
||||||
|
|
|
@ -16,6 +16,11 @@ var
|
||||||
exec = require('child_process').exec,
|
exec = require('child_process').exec,
|
||||||
cmd = 'node ' + __dirname + '/../tools/validate ';
|
cmd = 'node ' + __dirname + '/../tools/validate ';
|
||||||
|
|
||||||
|
|
||||||
|
// increase timeout
|
||||||
|
jasmine.asyncSpecWait.timeout = 20 * 1000;
|
||||||
|
|
||||||
|
|
||||||
describe('validate isX() using fastIndex', function() {
|
describe('validate isX() using fastIndex', function() {
|
||||||
|
|
||||||
it('should validate index.noun', function() {
|
it('should validate index.noun', function() {
|
||||||
|
|
Loading…
Reference in New Issue