@eudes/pronounceable

2.0.2 • Public • Published

pronounceable

Build Status Dependency Status npm npm npm

Pronounceable is a small module that allows you to test a word for pronounceability.

To use it, simply install via NPM and include it in your project file.

const {Pronounceable} = require('pronounceable');
const pronounceable = new Pronounceable();

Then, to test a word for pronounceability, use the test method.

console.log(pronounceable.test('samosa')); // true
console.log(pronounceable.test('xghsii')); // false

You can also use the module to score a word on its pronounceability, using the score method. The higher the output value the more pronounceable the word.

console.log(pronounceable.score('peonies')); // 0.10176356810708122
console.log(pronounceable.score('sshh')); // 0.0008556941146173743

To generate your own dataset use the train function. dataset must be a white-space separated string containing a list of words to train on.

const {train} = require("../pronounceable");
const dataset = fs.readFileSync(path.resolve(__dirname, "../data/dictionary.txt"), "utf8");
const pronounceable = train(dataset);
pronounceable.test('goo'); // true

Package Sidebar

Install

npm i @eudes/pronounceable

Weekly Downloads

23

Version

2.0.2

License

MIT

Unpacked Size

1.98 MB

Total Files

13

Last publish

Collaborators

  • eudes