{"_id":"@cognigy/node-wordnet","_rev":"30-429787c35244bfe6440d1ffe6ecfe0f7","name":"@cognigy/node-wordnet","dist-tags":{"latest":"0.1.14"},"versions":{"0.1.12":{"name":"@cognigy/node-wordnet","version":"0.1.12","keywords":["wordnet"],"author":{"name":"Stuart Watt","email":"stuart@morungos.com"},"license":"MIT","_id":"@cognigy/node-wordnet@0.1.12","maintainers":[{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"}],"homepage":"https://github.com/morungos/wordnet","bugs":{"url":"https://github.com/morungos/wordnet/issues"},"dist":{"shasum":"3867c9c7c32abe8a9c9e9935d4a75b2b66e2c14f","tarball":"https://registry.npmjs.org/@cognigy/node-wordnet/-/node-wordnet-0.1.12.tgz","integrity":"sha512-bapCx3ycv5g+KpwTfsJM2v8xUIgsV+PSynKKQ+nFP6R7wx/5Re36jNtL4/jI5bRug1spqBOOsl8yCBOfzQPGFQ==","signatures":[{"sig":"MEYCIQCfx4kipsmGDov3ZXWQ0MIvLWpiknhmGXZZS7XaMIzocQIhAOR6Qsts8mPVvAPnMlVlPMSkROHz6kdQ9KVaaY1zgS3b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/wordnet.js","_from":".","_shasum":"3867c9c7c32abe8a9c9e9935d4a75b2b66e2c14f","gitHead":"a20b6c31a4b232f5e548211d80a39181e5a9479c","scripts":{"test":"gulp test"},"_npmUser":{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"},"repository":{"url":"git+https://github.com/morungos/wordnet.git","type":"git"},"_npmVersion":"4.2.0","description":"Node.js interface for Wordnet","directories":{},"_nodeVersion":"7.10.0","dependencies":{"async":"^0.9.0","bluebird":"^2.6.0","es6-shim":"^0.22.1","lru-cache":"^2.5.0"},"devDependencies":{"chai":"^1.10.0","gulp":"^3.8.10","mocha":"^2.2.5","gulp-mocha":"^2.0.0","gulp-coffee":"^2.2.0","coffee-script":"^1.8.0","chai-as-promised":"^4.1.1","@cognigy/wndb-with-exceptions":"3.0.2"},"_npmOperationalInternal":{"tmp":"tmp/node-wordnet-0.1.12.tgz_1494413304282_0.6888181527610868","host":"packages-18-east.internal.npmjs.com"}},"0.1.13":{"name":"@cognigy/node-wordnet","version":"0.1.13","keywords":["wordnet"],"author":{"name":"Stuart Watt","email":"stuart@morungos.com"},"license":"MIT","_id":"@cognigy/node-wordnet@0.1.13","maintainers":[{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"}],"homepage":"https://github.com/morungos/wordnet","bugs":{"url":"https://github.com/morungos/wordnet/issues"},"dist":{"shasum":"a82dd9aa05d824fd6f0d6788478fc835378b1879","tarball":"https://registry.npmjs.org/@cognigy/node-wordnet/-/node-wordnet-0.1.13.tgz","integrity":"sha512-Gg+gFD+9p4eHMvk+OZPXcw9FkCZeXbEfefiTX+nc+FG0FP/xLoOlpYjq9z1iJDkZutvxYO9NPxGlRDZpG1uatA==","signatures":[{"sig":"MEYCIQDBEkPDETq3p2Fa0NqmUedNuJsDb0gdz1110m6o42lX0wIhAJy2igVDxab9CxJt0eY881H1V/TMhkCHf3vhiXN1lLw5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/wordnet.js","_from":".","_shasum":"a82dd9aa05d824fd6f0d6788478fc835378b1879","gitHead":"6a9dce12cf94f873579b486c51387a9c8996b1e2","scripts":{"test":"gulp test"},"_npmUser":{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"},"repository":{"url":"git+https://github.com/morungos/wordnet.git","type":"git"},"_npmVersion":"4.2.0","description":"Node.js interface for Wordnet","directories":{},"_nodeVersion":"7.10.0","dependencies":{"async":"^0.9.0","bluebird":"^2.6.0","es6-shim":"^0.22.1","lru-cache":"^2.5.0"},"devDependencies":{"chai":"^1.10.0","gulp":"^3.8.10","mocha":"^2.2.5","gulp-mocha":"^2.0.0","gulp-coffee":"^2.2.0","coffee-script":"^1.8.0","chai-as-promised":"^4.1.1","@cognigy/wndb-with-exceptions":"3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/node-wordnet-0.1.13.tgz_1494413520407_0.7309724430087954","host":"packages-18-east.internal.npmjs.com"}},"0.1.14":{"name":"@cognigy/node-wordnet","version":"0.1.14","keywords":["wordnet"],"author":{"name":"Stuart Watt","email":"stuart@morungos.com"},"license":"MIT","_id":"@cognigy/node-wordnet@0.1.14","maintainers":[{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"}],"homepage":"https://github.com/morungos/wordnet","bugs":{"url":"https://github.com/morungos/wordnet/issues"},"dist":{"shasum":"609f54dac117a6cbb3c96874332fab819f3ebb31","tarball":"https://registry.npmjs.org/@cognigy/node-wordnet/-/node-wordnet-0.1.14.tgz","integrity":"sha512-9UcNDvUH1zkZYs3dKbtZ5z39xOCaAO8FLJ744a0nWxQXB03OwMXcMHtE3lY3BgrcPP9CMAe10ZD1HtuwBl4cNA==","signatures":[{"sig":"MEUCIG1tS1a9iJZ8QIVFPJEhx3s1yLF514RTxsyW402f8WxWAiEAtxUd3wj3z3lcYb3TEHq/BqNvcubcBzxKek8Dzp69D4U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzdPqCRA9TVsSAnZWagAAJcAQAILZvLZJINmJBQ53C/UZ\n3GOUJjZ8dGjX2ENLsIQehXvSVfVO/J0QTn8GHXbjjMIT8AfkOTGPc3GfQ5Ef\njsDjh2w9tmK9FV/qmwx/iyhAc2u3CLyyYB+iRD1p0BFs4wPtzSDG4XRvABWB\n4u73Cr8CRVaPmD8mohDcu5vqFHXjhKjMaQKuUfWPRdmBzZIG5DedKxeDHawc\nh6t30gvHOUwpuA8j3lotMy6BrPFL986BW/BOrrvfYpeV8phvrjAaSjHw7XZM\nq8k/58+fA910pcYxHzlwbOYrjsW6B9RYxRXNu2hWoYbS1XPdHqsR+SzoaVwm\nk7d0nl5KhYbXkOjvwcyssZNYPeYHZKSIV7VsD6dyWJ5Kth4gFiV1Bo6X3jx+\nRvtI4Jx6kOa28SZQNxyFV7WLuPHT1D43hKBIpRlMrhwk+XEPQArl5tZilVZ3\nQSdDDAToWccehTEos0tixdkZdMLLNDWoihdT+a/pHekzRuWv5IYJbQnHEEzE\nmLZrL/WBlltkacLJWGmAgb2eZ2joRt7pQUI2v8wHAVU4DmgFXMLXSC4l/VX6\neXkbHE0hhWCxTX/AqPpVJ6qLb+bYiSkybnlHkOfCLTZV9rdupl3qEH3IIlsy\nhSg7uiWRdZokRQC5KYCVbSpk/WtNiQWVOqD3J0+OAd16opppVtBiWr1NkQGv\napoa\r\n=niwu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/wordnet.js","_from":".","_shasum":"609f54dac117a6cbb3c96874332fab819f3ebb31","gitHead":"26dcc1243b0b827c54f20cabe70875e143bbe500","scripts":{"test":"gulp test"},"_npmUser":{"name":"mayrbenjamin92","email":"b.mayr@cognigy.com"},"repository":{"url":"git+https://github.com/morungos/wordnet.git","type":"git"},"_npmVersion":"4.2.0","description":"Node.js interface for Wordnet","directories":{},"_nodeVersion":"7.10.0","dependencies":{"async":"^0.9.0","bluebird":"^2.6.0","es6-shim":"^0.22.1","lru-cache":"^2.5.0"},"devDependencies":{"chai":"^1.10.0","gulp":"^3.8.10","mocha":"^2.2.5","gulp-mocha":"^2.0.0","gulp-coffee":"^2.2.0","coffee-script":"^1.8.0","chai-as-promised":"^4.1.1","@cognigy/wndb-with-exceptions":"3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/node-wordnet-0.1.14.tgz_1494414012954_0.2928574508987367","host":"packages-18-east.internal.npmjs.com"}}},"time":{"created":"2017-05-10T10:48:25.695Z","modified":"2026-08-17T13:15:00.836Z","0.1.12":"2017-05-10T10:48:25.695Z","0.1.13":"2017-05-10T10:52:01.868Z","0.1.14":"2017-05-10T11:00:14.608Z"},"bugs":{"url":"https://github.com/morungos/wordnet/issues"},"author":{"name":"Stuart Watt","email":"stuart@morungos.com"},"license":"MIT","homepage":"https://github.com/morungos/wordnet","keywords":["wordnet"],"repository":{"url":"git+https://github.com/morungos/wordnet.git","type":"git"},"description":"Node.js interface for Wordnet","maintainers":[{"email":"b.mayr@cognigy.com","name":"mayrbenjamin92"},{"email":"kontakt@robinschuster.net","name":"pedily"},{"email":"npm@ostasevich.com","name":"kwinto"},{"email":"wellereitetclub@gmail.com","name":"dshire"},{"email":"lekshmi.kolappan@gmail.com","name":"lkolapp"},{"email":"m.frindt@cognigy.com","name":"catharsis68"},{"email":"a.komitaki@cognigy.com","name":"cu4nt0m"},{"email":"jorda.murria.xavier@gmail.com","name":"x.jorda"},{"email":"r.chhetri@cognigy.com","name":"rchhetri-cognigy"},{"email":"fahad.khalid@cognigy.nice.com","name":"fkhalid"},{"email":"lucas.sramos.de@gmail.com","name":"lucasdssramos"},{"email":"f.asad@cognigy.com","name":"f.asad"},{"email":"Jose.OrtegaDiaz@nice.com","name":"jortegadiazcognigy"},{"email":"p.heltewig@cognigy.com","name":"mastasky"},{"email":"diogo.gomes@nice.com","name":"dcg-cognigy"},{"email":"fabian.gruber@nice.com","name":"cognigy-fabian"},{"email":"anton.demin@nice.com","name":"anton.demin"}],"readme":"Wordnet\n=======\n\nThis is an implementation of a Wordnet API in pure JavaScript. It was initially\nadapted from [NaturalNode/natural](https://github.com/NaturalNode/natural), which had the\noriginal core implementation, but which was very basic and hard to use for higher-level\ntasks.\n\nThis is a drop-in replacement for the Wordnet access in\n[NaturalNode/natural](https://github.com/NaturalNode/natural), but with additional\nmethods that make it easier to use for other tasks, and probably higher in performance\ntoo. For example, the original implementation opens file handles for more or less\neach individual low-level query.\n\nMore recently, it includes a promise-based set of methods parallel to callback ones.\nBecause most of the access is asynchronous, this does make it easier to use. Methods\nending `Async` return promises. This will also assist error handling, when we get to\nimplement that, as it was not the strongest part of the original implementation.\n\nUsage\n-----\n\nYou'll need a copy of WordNet. There are several on Github, but for full functionality,\nat least for now, I'd suggest using: `wndb-with-exceptions`, available at:\nhttps://github.com/morungos/WNdb-with-exceptions, as it includes the morphological\nexception lists needed by `validForms`. If you don't care about that, you can get\nby with https://github.com/moos/WNdb, or even just download WordNet directly.\n\nThis module doesn't download and install the WordNet files, because there are\nseveral versions and it feels impolite to download and install one for you.\n\nFor easy use, therefore, it might be best to add both this module and a WordNet\ndata module to your project, e.g.:\n\n```\nnpm install node-wordnet --save\nnpm install wndb-with-exceptions --save\n```\n\nAPI\n---\n\n### new WordNet([options | string])\n\nThe constructor returns a new object to access a WordNet database. The passed\noptions configure the interface. The following options are available:\n\n *  __dataDir__ -- specifies the location of the Wordnet directory.\n\n    If this option isn't passed, the module uses `require` to locate\n    `wndb-with-exceptions`, so if you don't want to deploy your own WordNet, all you\n    need to do is add `wndb-with-exceptions` as an application dependency and not\n    pass a directory to the constructor.\n    The original WordNet data files can always be manually downloaded and installed\n    anywhere from http://wordnet.princeton.edu/wordnet/download.\n\n    As a shortcut, if you pass a string directly to the constructor, it's interpreted\n    as a Wordnet directory, and all other options default in sensible ways.\n\n *  __cache__ -- adds an LRU cache to the Wordnet access.\n\n    If the option is false, no cache is set; and if it is true, then a cache (using\n    `lru-cache` with a default size of 2000 items) is set. In addition, the cache can be\n    an object. If that object has a `get` method then it's used as a cache directly, and\n    if it doesn't, it's assumed to be a configuration object which will be used to\n    configure a new `lru-cache`.\n\n\n### lookup(word, callback)\n\nHere's an example of looking up definitions for the word, \"node\". The callback\ncan accept one or two arguments, if two, the first is an error flag and the second\nthe results.\n\n```javascript\nvar wordnet = new WordNet()\n\nwordnet.lookup('node', function(results) {\n    results.forEach(function(result) {\n        console.log('------------------------------------');\n        console.log(result.synsetOffset);\n        console.log(result.pos);\n        console.log(result.lemma);\n        console.log(result.synonyms);\n        console.log(result.pos);\n        console.log(result.gloss);\n    });\n});\n```\n\n### lookupAsync(word)\n\nSimilar to `lookup(word, callback)` but returning a promise.\n\n### get(offset, pos, callback)\n\nGiven a synset offset and a part of speech, a definition can be looked up directly. The callback\ncan accept one or two arguments, if two, the first is an error flag and the second\nthe result.\n\n```javascript\nvar wordnet = new WordNet()\n\nwordnet.get(4424418, 'n', function(result) {\n    console.log('------------------------------------');\n    console.log(result.lemma);\n    console.log(result.pos);\n    console.log(result.gloss);\n    console.log(result.synonyms);\n});\n```\n\n### getAsync(offset, pos)\n\nSimilar to `get(offset, pos, callback)` but returning a promise.\n\n### validForms(word, callback)\n\nReturns valid morphological exceptions. The callback\ncan accept one or two arguments, if two, the first is an error flag and the second\nthe results.\n\n```javascript\nvar wordnet = new WordNet()\nwordnet.validForms('axes#n', console.log);\n```\n\n### validFormsAsync(word)\n\nSimilar to `validForms(word, callback)` but returning a promise.\n\n### querySense(query, callback)\n\nQueries WordNet to find all the senses of a given word, optionally with a\npart-of-speech. The callback\ncan accept one or two arguments, if two, the first is an error flag and the second\nthe results.\n\n```javascript\nvar wordnet = new WordNet()\nwordnet.querySense('axes#n', console.log);\n```\n\n### querySenseAsync(query)\n\nSimilar to `querySense(query, callback)` but returning a promise.\n\n\n### findSense(query, callback)\n\nQueries WordNet to find full information on a single sense of a term. The callback\ncan accept one or two arguments, if two, the first is an error flag and the second\nthe results.\n\n```javascript\nvar wordnet = new WordNet()\nwordnet.findSense('lie#v#1', console.log);\n```\n\n### findSenseAsync(query)\n\nSimilar to `findSense(query, callback)` but returning a promise.\n\n\n### close()\n\nCloses all the file handles being used by this instance. If new queries are\ndone, the files may be silently re-opened, but that probably isn't a very good\nplan. It should be assumed that re-use of an instance after close is\ndeprecated.\n","readmeFilename":"README.md"}