Yandex Predictor
Yandex.Prediсtor is an application that prompts the most likely continuation of words or phrases typed by the user. It simplifies text entry, especially on mobile devices. In this case, the predictor takes into account possible typos. You can use it with this NPM package.
Follow this list
- Get the API key here
npm i --save yandex-predictor
Here are how to use
const YaPre = require('yandex-predictor');
let ya = new YaPre('API_KEY');
getLangs
Get the list of languages
ya.getLangs((langsObj) => {
console.log(langsObj);
});
Param | Type | Default |
---|
callback | func(obj) | - |
complete
Get the complete of phrase
ya.complete('Кахаю ц', (obj) => {
console.log(obj);
}, 'be', 10);
Param | Type | Default |
---|
q | string | - |
callback | func(obj) | - |
lang | string | 'en' |
limit | int | 5 |