From e5e2db825882d404e0318328a643e11ff77aead5 Mon Sep 17 00:00:00 2001 From: lukem512 Date: Sun, 3 Apr 2016 16:07:25 +0100 Subject: [PATCH] Added examples --- examples/score.js | 14 ++++++++++++++ examples/test.js | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 examples/score.js create mode 100644 examples/test.js diff --git a/examples/score.js b/examples/score.js new file mode 100644 index 0000000..69d7ea8 --- /dev/null +++ b/examples/score.js @@ -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)); diff --git a/examples/test.js b/examples/test.js new file mode 100644 index 0000000..6b643f7 --- /dev/null +++ b/examples/test.js @@ -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));