JavaScript dictionary-based word prediction library.
npm install predictionaryhtml
`
or install the package via npm:
`
npm install predictionary --save
`
Note: to use inside a nodejs application use the flag --experimental-modules in order to be able to use Predictionary which is written as ES6 module. See nodejs demo which can be run with:
node --experimental-modules demo/node-demo/app.mjs
Basic usage
Minimum working example for basic usage:
`javascript
import Predictionary from 'predictionary' //only if installed via npm
let predictionary = Predictionary.instance();
predictionary.addWords(['apple', 'apricot', 'banana']);
let suggestions = predictionary.predict('ap'); // == ['apple', 'apricot'];
``