Skip to content

Unofficial PHP package to get results from Yandex translate OCR

License

Notifications You must be signed in to change notification settings

errogaht/yandex-ocr-php

Repository files navigation

yandex-ocr-php

Now its not working, yandex ban it, but if you want you can repair it and create pull request

Latest Version on Packagist Software License Build Status Total Downloads

Unofficial PHP package to get results from Yandex translate OCR

Features:

  • Upload image to Yandex Translate OCR and get response in PHP array
  • Convert response to plain text
  • Unit test
  • Daily build guarantee that package is work, if you see build badge above green - that's mean package work right now

Install

composer require errogaht/yandex-ocr-php

Usage

You can see test file:

// can pass optional arguments: $langFrom, $langTo, API $url
$client = new \Errogaht\YandexOCR\Client();

//tell path to recognizing file
$client->setFilePath(__DIR__ . '/1e741d3b-ba67-42e5-8229-f07a72072c96.png');

//get response from Yandex translate
$response = $client->request();

//convert response to plain text
$texter = new \Errogaht\YandexOCR\Response2Text($response);
$text = $texter->getText();

Contributing

Please see CONTRIBUTING for details.

About

Unofficial PHP package to get results from Yandex translate OCR

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages