3.4.2 • Published 5 years ago

wordnok v3.4.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

wordnok

This is a wrapper that gets nouns, frequencies, and parts of speech from the Wordnik REST API.

Methods and their callback signatures:

  • getTopic(done): error, random noun.
  • getPartsOfSpeech(word, done): error, part of speech string.
  • getPartsOfSpeechForMultipleWords(wordArray, done): error, array of parts of speech.
  • getWordFrequency(word, done): error, number.
  • getWordFrequencies(wordArray, done): error, array of frequencies.

Installation

npm install wordnok

Usage

var createWordnok = require('wordnok');
var wordnok = createWordnok({
  apiKey: 'kljhasdfkjahsdlfiq89243rsdhflksjdfhaskjhdf982kjhd'
});
wordnok.getPartsOfSpeechForMultipleWords(
  [
    'students',
    'realize',
    'the'
  ],
  function done(error, parts) {
    console.log(parts);
  }
);

Output:

[
   [
       'noun'
   ],
   [
     'verb-transitive',
     'verb-transitive',
     'verb-transitive',
     'verb-transitive'
   ],
   [
     'definite-article',
     'definite-article',
     'definite-article',
     'definite-article'
   ]
]

Tests

First, create a config.js file in the root directory that has your Wordnik API like this:

module.exports = {
  wordnikAPIKey: 'kljhasdfkjahsdlfiq89243rsdhflksjdfhaskjhdf982kjhd'
};

Then, run tests with make test.

License

MIT.

3.4.2

5 years ago

3.4.1

6 years ago

3.4.0

6 years ago

3.3.8

6 years ago

3.3.7

6 years ago

3.3.6

6 years ago

3.3.5

7 years ago

3.3.4

7 years ago

3.3.3

7 years ago

3.3.2

7 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.0

9 years ago

3.1.0

9 years ago

3.0.0

10 years ago

2.3.1

10 years ago

2.3.0

10 years ago

2.2.1

10 years ago

2.2.0

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.1.0

10 years ago

1.0.0

11 years ago