Aspose.OCR.Examples.CSharp.FormattingAndManipulatingOCR.AutomaticallyCorrectTheSpellings.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:AutomaticallyCorrectTheSpellings
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_OCR();
            // Create an instance of OcrEngine class
            OcrEngine ocr = new OcrEngine();

            // Set the Image property of OcrEngine by reading an image file
            ocr.Image = ImageStream.FromFile(dataDir + "sampleocr_spell.bmp");

            // Set the DoSpellingCorrection to true
            ocr.Config.DoSpellingCorrection = true;

            // Perform OCR operation
            if (ocr.Process())
            {
                // Display results
                Console.WriteLine(ocr.Text);
            }
            // ExEnd:AutomaticallyCorrectTheSpellings            
        }
    }
AutomaticallyCorrectTheSpellings