Skip to content

Commit e5e2db8

Browse files
committed
Added examples
1 parent 1797c57 commit e5e2db8

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

examples/score.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Luke Mitchell, 2016
2+
// https://github.com/lukem512/pronounceable
3+
4+
var pronounceable = require('pronounceable');
5+
6+
// Scoring a word using the standard dataset.
7+
// The output is a normalised score. The higher the number
8+
// the more pronounceable the word.
9+
10+
var morePronouncable = 'peonies';
11+
console.log(morePronouncable, pronounceable.score(morePronouncable));
12+
13+
var lessPronouncable = 'sshh';
14+
console.log(lessPronouncable, pronounceable.score(lessPronouncable));

examples/test.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Luke Mitchell, 2016
2+
// https://github.com/lukem512/pronounceable
3+
4+
var pronounceable = require('pronounceable');
5+
6+
// Testing a word using the standard dataset.
7+
// The `test` method returns true is a word is pronouncable
8+
// and false otherwise.
9+
10+
var yes = 'samosa';
11+
console.log(yes, pronounceable.test(yes));
12+
13+
var no = 'xghsii';
14+
console.log(no, pronounceable.test(no));

0 commit comments

Comments
 (0)