Setting the OcrEngine to Automatically Correct the Spellings in PHP

Aspose.OCR - Setting the OcrEngine to Automatically Correct the Spellings

To Set the OcrEngine to Automatically Correct the Spellings using Aspose.OCR Java for PHP, simply invoke CorrectSpellings module. Here you can see example code.

PHP Code

## Initialize an instance of OcrEngine

$ocr_engine = new OcrEngine();

\# Set the Image property by loading the image from file path location

$imageStream = new ImageStream();

$ocr_engine->setImage($imageStream->fromFile($dataDir . 'ocr.png'));

\# Set the DoSpellingCorrection to true

$ocr_engine->getConfig()->setDoSpellingCorrection(true);

\# Process the image

if ($ocr_engine->process()){

\# Display the result

print "Text: " . (string)$ocr_engine->getText().PHP_EOL;

}

Download Running Code

Download Setting the OcrEngine to Automatically Correct the Spellings (Aspose.OCR) from any of the below mentioned social coding sites: