node-wordnet
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -470,7 +470,13 @@ var DataFile, IndexFile, Promise, WordNet, async, fs, path, | ||
reducer = function(previous, current, next) { | ||
return _validForms(wordnet, string + "#" + current, function(err, value) { | ||
return next(null, previous.concat(value)); | ||
return _validForms(wordnet, string + "#" + current, function(value) { | ||
if (value === void 0) { | ||
return next(null, previous); | ||
} else { | ||
return next(null, previous.concat(value)); | ||
} | ||
}); | ||
}; | ||
return async.reduce(['n', 'v', 'a', 'r'], [], reducer, callback); | ||
return async.reduce(['n', 'v', 'a', 'r'], [], reducer, function(err, result) { | ||
return callback(result); | ||
}); | ||
} else { | ||
@@ -477,0 +483,0 @@ possibleForms = forms(wordnet, word + "#" + pos); |
{ | ||
"name": "node-wordnet", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Node.js interface for Wordnet", | ||
@@ -5,0 +5,0 @@ "main": "lib/wordnet.js", |
@@ -20,5 +20,36 @@ Wordnet | ||
Usage | ||
----- | ||
You'll need a copy of WordNet. There are several on Github, but for full functionality, | ||
at least for now, I'd suggest using: `wndb-with-exceptions`, available at: | ||
https://github.com/morungos/WNdb-with-exceptions, as it includes the morphological | ||
exception lists needed by `validForms`. If you don't care about that, you can get | ||
by with https://github.com/moos/WNdb, or even just download WordNet directly. | ||
This module doesn't download and install the WordNet files, because there are | ||
several versions and it feels impolite to download and install one for you. | ||
For easy use, therefore, it might be best to add both this module and a WordNet | ||
data module to your project, e.g.: | ||
``` | ||
npm install node-wordnet --save | ||
npm install wndb-with-exceptions --save | ||
``` | ||
API | ||
--- | ||
### new WordNet([directory]) | ||
The constructor returns a new object to access a WordNet database at the specified | ||
directory. If no directory is passed, the module uses `require` to locate | ||
`wndb-with-exceptions`, so if you don't want to deploy your own WordNet, all you | ||
need to do is add `wndb-with-exceptions` as an application dependency and not | ||
pass a directory to the constructor. | ||
The original WordNet data files can always be manually downloaded and installed | ||
anywhere from http://wordnet.princeton.edu/wordnet/download. | ||
### lookup(word, callback) | ||
@@ -25,0 +56,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75628
712
130