3.0.0 • Published 6 years ago

nounfinder v3.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 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

6 years ago

2.0.14

7 years ago

2.0.13

8 years ago

2.0.12

8 years ago

2.0.11

8 years ago

2.0.10

8 years ago

2.0.9

8 years ago

2.0.8

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

9 years ago

2.0.3

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.2.1

11 years ago

1.2.0

11 years ago

1.1.1

11 years ago

1.1.0

11 years ago

1.0.0

11 years ago