Skip to content

Commit

Permalink
Added examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lukem512 committed Apr 3, 2016
1 parent 1797c57 commit e5e2db8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/score.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Luke Mitchell, 2016
// https://github.com/lukem512/pronounceable

var pronounceable = require('pronounceable');

// Scoring a word using the standard dataset.
// The output is a normalised score. The higher the number
// the more pronounceable the word.

var morePronouncable = 'peonies';
console.log(morePronouncable, pronounceable.score(morePronouncable));

var lessPronouncable = 'sshh';
console.log(lessPronouncable, pronounceable.score(lessPronouncable));
14 changes: 14 additions & 0 deletions examples/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Luke Mitchell, 2016
// https://github.com/lukem512/pronounceable

var pronounceable = require('pronounceable');

// Testing a word using the standard dataset.
// The `test` method returns true is a word is pronouncable
// and false otherwise.

var yes = 'samosa';
console.log(yes, pronounceable.test(yes));

var no = 'xghsii';
console.log(no, pronounceable.test(no));

0 comments on commit e5e2db8

Please sign in to comment.