# yandex-predictor

> The API Client for Yandex Predictor

Latest version **0.2.1** (published 2018-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install yandex-predictor
pnpm add yandex-predictor
yarn add yandex-predictor
bun add yandex-predictor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-11-13 |
| First published | 2018-11-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Kolja P |
| Maintainers | ptaberg |
| Keywords | yandex, predictor, api, client |

## Links

- npm: https://www.npmjs.com/package/yandex-predictor
- Repository: https://github.com/ptaberg/yandex-predictor
- Homepage: https://github.com/ptaberg/yandex-predictor#readme
- Issues: https://github.com/ptaberg/yandex-predictor/issues
- npm.io page: https://npm.io/package/yandex-predictor

## Dependencies (1)

- [request](https://npm.io/package/request.md) ^2.88.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2018-11-13
- 0.0.5 — 2018-11-05
- 0.0.4 — 2018-11-05
- 0.0.3 — 2018-11-05
- 0.0.2 — 2018-11-05
- 0.0.1 — 2018-11-05

## README

# 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](https://tech.yandex.ru/keys/get/?service=pdct)
* `npm i --save yandex-predictor`

Here are how to use
```javascript
// require the package
const YaPre = require('yandex-predictor');
// Create an instance of the class with the API key.
let ya = new YaPre('API_KEY');
```

## getLangs
Get the list of languages
```javascript
// example of using getLangs method
ya.getLangs((langsObj) => { // callback with the Object of all languages in ISO
  console.log(langsObj);
});
```
| Param         | Type                  | Default  |
| ------------- |:---------------------:| --------:|
| callback      | func(obj)           |  -       |


## complete
Get the complete of phrase
```javascript
// example of using complete method
ya.complete('Кахаю ц', (obj) => {
  console.log(obj); //
}, 'be', 10);
```
| Param         | Type                  | Default  |
| ------------- |:---------------------:| --------:|
| q             | string                |  -       |
| callback      | func(obj)             |  -       |
| lang          | string                |  'en'    |
| limit         | int                   |  5       |

---
_Source: https://npm.io/package/yandex-predictor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
