<commit_before>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Aspose.Pdf.Text;
using Aspose.Pdf.Text.TextOptions;

namespace FullTextIndexTests
{
    class Program
    {
        [STAThread]
        private static void Main(string[] args)
        {
            var dialog = new OpenFileDialog()
                         {
                             Multiselect = false
                         };
            dialog.ShowDialog();

            var fileName = dialog.FileName;

            var extension = Path.GetExtension(fileName);
            if (extension == ".pdf")
            {
                var doc = new Aspose.Pdf.Document(fileName);
                var textAbsorber = new TextAbsorber();
                doc.Pages.Accept(textAbsorber);

                var text = textAbsorber.Text;

                Console.WriteLine(text);
            }

            Console.ReadLine();
        }
    }
}<commit_msg>Aspose via pdfextractor - better api, result almost the same<commit_after>﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Aspose.Pdf.Facades;
using Aspose.Pdf.Text;
using Aspose.Pdf.Text.TextOptions;

namespace FullTextIndexTests
{
    class Program
    {
        [STAThread]
        private static void Main(string[] args)
        {
            var dialog = new OpenFileDialog()
                         {
                             Multiselect = false
                         };
            dialog.ShowDialog();

            var fileName = dialog.FileName;

            var extension = Path.GetExtension(fileName);
            if (extension == ".pdf")
            {
                PdfExtractor pdfExtractor = new PdfExtractor();
                pdfExtractor.BindPdf(fileName);

                //use parameterless ExtractText method
                pdfExtractor.ExtractText();

                MemoryStream tempMemoryStream = new MemoryStream();
                pdfExtractor.GetText(tempMemoryStream);

                string text = "";
                //specify Unicode encoding type in StreamReader constructor
                using (StreamReader streamReader = new StreamReader(tempMemoryStream, Encoding.Unicode))
                {
                    streamReader.BaseStream.Seek(0, SeekOrigin.Begin);
                    text = streamReader.ReadToEnd();
                }

                Console.WriteLine(text);
            }

            Console.ReadLine();
        }
    }
}
{'fraction_non_alphanumeric': 0.0839319470699433, 'fraction_numerical': 0.0003780718336483932, 'mean_word_length': 1.6120434353405726, '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': '2462445', 'n_tokens_mistral': 678, 'n_tokens_neox': 644, 'n_words': 148}