Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asterics/predictionary
A learning JavaScript dictionary-based word prediction / autocomplete / suggestion library.
https://github.com/asterics/predictionary
autocomplete autocompletion javascript javascript-library prediction suggestions text text-processing typing word-prediction words write writing
Last synced: 16 days ago
JSON representation
A learning JavaScript dictionary-based word prediction / autocomplete / suggestion library.
- Host: GitHub
- URL: https://github.com/asterics/predictionary
- Owner: asterics
- License: agpl-3.0
- Created: 2019-05-21T07:35:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T19:42:40.000Z (almost 2 years ago)
- Last Synced: 2024-11-18T12:46:45.958Z (26 days ago)
- Topics: autocomplete, autocompletion, javascript, javascript-library, prediction, suggestions, text, text-processing, typing, word-prediction, words, write, writing
- Language: JavaScript
- Homepage: https://asterics.github.io/predictionary/demo/
- Size: 2.19 MB
- Stars: 35
- Watchers: 8
- Forks: 4
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-assistivetech - Asterics-Predictionary - based word prediction library with self-learning abilities. (Word Prediction)
README
# Predictionary
JavaScript dictionary-based word prediction library with self-learning abilities.## Installation
Drop the following into your page:```html
```
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](https://github.com/asterics/predictionary/blob/master/demo/node-demo/app.mjs) 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 npmlet predictionary = Predictionary.instance();
predictionary.addWords(['apple', 'apricot', 'banana']);
let suggestions = predictionary.predict('ap'); // == ['apple', 'apricot'];
```## Demo
See working demo: [to live demo](https://asterics.github.io/predictionary/demo/)## API Documentation
see full API documentation: [to API documentation](https://asterics.github.io/predictionary/docs/Predictionary.html)## Acknowledgements
Thanks to Mark Davies, Professor of Linguistics at Brigham Young University (Utah), for the permission to use his n-gram sample data from https://www.ngrams.info/iweb.asp for training purposes of this library.Word frequency lists for demos are taken from the Centre for Translation Studies, University of Leeds, see http://corpus.leeds.ac.uk/list.html - thanks!