moos / wordpos

Part-of-speech utilities for node.js based on the WordNet database.
477 stars 41 forks source link

Random Word ? #5

Closed pyprism closed 10 years ago

pyprism commented 10 years ago

Is there any way to get some random word ?

moos commented 10 years ago

Great suggestion. There is now (version 0.1.10). Not yet pushed to npm because of dependency on natural. But you can do direct install:

$ npm install git://github.com/moos/wordpos

Eg:

var WordPOS = require('wordpos'),
    wordpos = new WordPOS();

wordpos.rand(function(result){
    console.log(result); // ['random word']
});

wordpos.rand({startsWith: 'foo', count: 3} function(result){
    console.log(result); // ['foot', 'footsore', 'foolish']
});

See readme for other methods.

pyprism commented 10 years ago

Thanks :)

On Sun, May 4, 2014 at 3:58 AM, Moos notifications@github.com wrote:

Great suggestion. There is now (version 0.1.10). Not yet pushed to npm because of dependency on natural. But you can do direct install:

$ npm install git://github.com/moos/wordpos

Eg:

var WordPOS = require('wordpos'), wordpos = new WordPOS();

wordpos.rand(function(result){ console.log(result); // ['random word'] });

wordpos.rand({startsWith: 'foo', count: 3} function(result){ console.log(result); // ['foot', 'footsore', 'foolish'] });

See readme for other methods.

— Reply to this email directly or view it on GitHubhttps://github.com/moos/wordpos/issues/5#issuecomment-42117513 .