From fe52692f45d891eecce9af04faf0574e624916ea Mon Sep 17 00:00:00 2001 From: Moos Date: Wed, 23 Dec 2015 21:34:39 -0800 Subject: [PATCH] Changed dependency to wordnet-db (was WNdb). Bump to 0.1.16. --- .travis.yml | 5 +++++ README.md | 39 ++++++++++++++++++++++----------------- package.json | 12 +++++++----- src/wordpos.js | 2 +- 4 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0213cd0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "stable" +before_script: + - npm install -g jasmine-node \ No newline at end of file diff --git a/README.md b/README.md index 0576ef0..b1f2c49 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,11 @@ wordpos ======= -wordpos is a set of part-of-speech (POS) utilities for Node.js using [natural's](http://github.com/NaturalNode/natural) WordNet module. +[![NPM version](https://img.shields.io/npm/v/wordpos.svg)](https://www.npmjs.com/package/wordpos) +[![Build Status](https://img.shields.io/travis/moos/wordpos/master.svg)](https://travis-ci.org/moos/wordpos) +wordpos is a set of *fast* part-of-speech (POS) utilities for Node.js using [natural's](http://github.com/NaturalNode/natural) WordNet module, offering **30x** performance over the natural. -## 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 @@ -33,7 +25,7 @@ wordpos.isAdjective('awesome', function(result){ // true 'awesome' ``` -Command-line: +Command-line: (see [CLI](bin)) ```bash $ wordpos def git git @@ -49,6 +41,17 @@ little British ``` +## 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 + ### Options ```js @@ -175,9 +178,8 @@ wordpos.lookupAdjective('awesome', console.log); synonyms: [ 'amazing', 'awe-inspiring', 'awesome', 'awful', 'awing' ], lexId: '0', ptrs: [], - gloss: 'inspiring awe or admiration or wonder; "New York is an amazing city"; "the Grand Canyon is an awe-inspiring -sight"; "the awesome complexity of the universe"; "this sea, whose gently awful stirrings seem to speak of some hidden s -oul beneath"- Melville; "Westminster Hall\'s awing majesty, so vast, so high, so silent" ' } ], 'awesome' + gloss: 'inspiring awe or admiration or wonder; awing majesty, so vast, so high, so silent" ' +} ], 'awesome' ``` In this case only one lookup was found. But there could be several. @@ -230,10 +232,10 @@ Returns tokenized array of words in `text`, less duplicates and stopwords. This #### WordPOS.WNdb -Access to the [WNdb](https://github.com/moos/WNdb) object containing the dictionary & index files. +Access to the [wordnet-db](https://github.com/moos/wordnet-db) object containing the dictionary & index files. #### WordPOS.natural -Access to underlying [natural](http://github.com/NaturalNode/natural) module. For example, WordPOS.natural.stopwords is the list of stopwords. +Access to underlying [natural](https://github.com/NaturalNode/natural) module. For example, WordPOS.natural.stopwords is the list of stopwords. ## Fast Index @@ -279,6 +281,9 @@ done in 1375 msecs ## Changes +0.1.16 + - Changed dependency to wordnet-db (renamed from WNdb) + 0.1.15 - Added `syn` (synonym) and `exp` (example) CLI commands. - Fixed `rand` CLI command when no start word given. diff --git a/package.json b/package.json index 51d9fd5..5779e82 100644 --- a/package.json +++ b/package.json @@ -3,16 +3,16 @@ "author": "Moos ", "keywords": ["natural", "language", "wordnet", "adjectives", "nouns", "adverbs", "verbs"], "description": "wordpos is a set of part-of-speech utilities for Node.js using natural's WordNet module.", - "version": "0.1.15", + "version": "0.1.16", "homepage": "https://github.com/moos/wordpos", "engines": { "node": ">=0.6" }, "bin": "./bin/wordpos-cli.js", "dependencies": { - "natural": "NaturalNode/natural", + "natural": "~0.1", "underscore": ">=1.3.1", - "WNdb": "latest", + "wordnet-db": "latest", "commander": "1.1.1" }, "devDependencies": { @@ -24,6 +24,8 @@ }, "main": "./src/wordpos.js", "scripts": { - "postinstall": "node tools/stat.js --no-stats index.adv index.adj index.verb index.noun" - } + "postinstall": "node tools/stat.js --no-stats index.adv index.adj index.verb index.noun", + "test": "jasmine-node spec/wordpos_spec.js spec/validate_spec.js --verbose" + }, + "license": "MIT" } diff --git a/src/wordpos.js b/src/wordpos.js index e507e43..0ff104d 100644 --- a/src/wordpos.js +++ b/src/wordpos.js @@ -15,7 +15,7 @@ var _ = require('underscore')._, WordNet = natural.WordNet, tokenizer = new natural.WordTokenizer(), natural_stopwords = makeStopwordString(natural.stopwords), - WNdb = require('WNdb'), + WNdb = require('wordnet-db'), fastIndex = null; try {