3.0.0 • Published 5 years ago

nounfinder v3.0.0

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

nounfinder

Extracts nouns from chunks of text, using the Wordnik API.

In version 2.0+, it's more strict. If a word has multiple uses, it only counts word as a noun if the most common usage (according to Wordnik) is as a noun.

Installation

npm install nounfinder

Usage

var createNounfinder = require('nounfinder');
var nounfinder = createNounfinder({
  wordnikAPIKey: 'kljhasdfkjahsdlfiq89243rsdhflksjdfhaskjhdf982kjhd'
});

var text = 'During this work, the street will be closed to motorists, except for abutters.';
nounfinder.getNounsFromText(text, function done(error, nouns) {
  console.log(nouns);
});

Output:

[
  'work',
  'street',
  'will',
  'motorist',
  'abutter'
]

nounfinder.filterNounsForInterestingness(nouns, 100, 
  function done(error, interestingNouns) {
    console.log(interestingNouns);
  }
);

Output:

[
  'motorist',
  'abutter'
]

The second parameter to filterNounsForInterestingness is a number that indicates how uncommon a word needs to be to be considered "interesting". The lower the number, the more uncommon the word needs to be.

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.0.0

5 years ago

2.0.14

6 years ago

2.0.13

7 years ago

2.0.12

7 years ago

2.0.11

7 years ago

2.0.10

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

11 years ago