<commit_before>//////////////////////////////////////////////////////////////////////////
// Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved.
//
// This file is part of Aspose.OCR. The source code in this file
// is only intended as a supplement to the documentation, and is provided
// "as is", without warranty of any kind, either expressed or implied.
//////////////////////////////////////////////////////////////////////////
using System;
using System.IO;

using Aspose.OCR;

namespace PerformOCROnImage
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");

            // Resource file
            const string resourceFileName = "Aspose.OCR.Resources.zip";
            // Source file: the file on which OCR will be performed.
            string imageFile = "Sampleocr.bmp";

            Console.WriteLine("Performing OCR on " + imageFile + "....");

            // Initialize OcrEngine.
            OcrEngine ocr = new OcrEngine();
            // Set the image.
            ocr.Image = ImageStream.FromFile(dataDir + imageFile);
            // Add language
            ocr.Languages.AddLanguage(Language.Load("english"));
            // Load the resource file
            using (ocr.Resource = new FileStream(resourceFileName, FileMode.Open))
            {
                try
                {
                    // Process the whole image<commit_msg>removed previous large sized commits<commit_after>//////////////////////////////////////////////////////////////////////////
// Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved.
//
// This file is part of Aspose.OCR. The source code in this file
// is only intended as a supplement to the documentation, and is provided
// "as is", without warranty of any kind, either expressed or implied.
//////////////////////////////////////////////////////////////////////////
using System;
using System.IO;

using Aspose.OCR;

namespace PerformOCROnImage
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");

            // Resource file
            const string resourceFileName = "Aspose.OCR.Resources.zip";
            // Source file: the file on which OCR will be performed.
            string imageFile = "Sampleocr.bmp";

            Console.WriteLine("Performing OCR on " + imageFile + "....");

            // Initialize OcrEngine.
            OcrEngine ocr = new OcrEngine();
            // Set the image.
            ocr.Image = ImageStream.FromFile(dataDir + imageFile);
            // Add language.
            ocr.Languages.AddLanguage(Language.Load("english"));
            // Load the resource file
            using (ocr.Resource = new FileStream(resourceFileName, FileMode.Open))
            {
                try
                {
                    // Process the whole image
{'fraction_non_alphanumeric': 0.18220338983050846, 'fraction_numerical': 0.005215123859191656, 'mean_word_length': 1.4014084507042253, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3140474', 'n_tokens_mistral': 724, 'n_tokens_neox': 684, 'n_words': 245}