예제 #1
0
        public static void ProcessStats(string basename)
        {
            //PdfWriteText.Test();
            //return;
            Console.WriteLine();
            Console.WriteLine("Program4 - Processing with hierachy");
            Console.WriteLine();

            // Extract(1);

            Examples.FollowText(basename);
            Examples.ShowHeaderFooter(basename);
            ExamplesWork.PrintAllSteps(basename, "bin", "bin");

            PdfReaderException.ContinueOnException();

            var conteudos = GetTextLinesWithPipelineBlockset(basename, out Execution.Pipeline pipeline)
                            .Log <AnalyzeLines>($"bin/{basename}-lines.txt")
                            .ConvertText <CreateStructures, TextStructure>()
                            .Log <AnalyzeStructuresCentral>($"bin/{basename}-central.txt")
                            //.PrintAnalytics($"bin/{basename}-print-analytics.txt")
                            .ConvertText <CreateTextSegments, TextSegment>()
                            .Log <AnalyzeSegmentTitles>($"bin/{basename}-tree.txt")
                            .Log <AnalyzeSegmentStats>($"bin/{basename}-segments-stats.txt")
                            .Log <AnalyzeSegments2>($"bin/{basename}-segments.csv")
                            .ConvertText <CreateTreeSegments, TextSegment>()
                            .ConvertText <TransformConteudo, Conteudo>()
                            .ToList();

            var validation = pipeline.Statistics.Calculate <ValidateFooter, StatsPageFooter>();

            //Create XML
            var createArticle = new TransformArtigo();
            var artigos       = createArticle.Create(conteudos);

            createArticle.CreateXML(artigos, basename);

            var validator = new ProgramValidatorXML();

            validator.ValidateArticle("bin");
        }
예제 #2
0
        public static void Process(string basename, string inputfolder, string outputfolder)
        {
            logDir = Directory.CreateDirectory($"{outputfolder}/Log").FullName;
            xmlDir = Directory.CreateDirectory($"{outputfolder}/XMLs").FullName;
            errors = Directory.CreateDirectory($"{outputfolder}/PDF-Errors").FullName;

            PdfReaderException.ContinueOnException();

            //ExamplesWork.PrintAllSteps(basename, inputfolder, outputfolder);

            var conteudos = GetTextLines(basename, inputfolder, outputfolder, out Execution.Pipeline pipeline)
                            .Log <AnalyzeLines>($"{logDir}/{basename}-lines.txt")
                            .ConvertText <CreateTextLineIndex, TextLine>()
                            .ConvertText <CreateStructures, TextStructure>()
                            .Log <AnalyzeStructuresCentral>($"{logDir}/{basename}-central.txt")
                            .ShowPdf <ShowStructureCentral>($"{logDir}/{basename}-show-central.pdf")
                            .PrintAnalytics($"{logDir}/{basename}-print-analytics.txt")
                            .ConvertText <CreateTextSegments, TextSegment>()
                            .Log <AnalyzeSegmentTitles>($"{logDir}/{basename}-tree.txt")
                            .Log <AnalyzeSegmentStats>($"{logDir}/{basename}-segments-stats.txt")
                            .Log <AnalyzeSegments2>($"{logDir}/{basename}-segments.csv")
                            .ConvertText <CreateTreeSegments, TextSegment>()
                            .Log <AnalyzeTreeStructure>($"{logDir}/{basename}-tree-data.txt")
                            .ConvertText <TransformConteudo, Conteudo>()
                            .ConvertText <AggregateAnexo, Conteudo>()
                            .ConvertText <AggregateSingularBody, Conteudo>()
                            .ToList();
            //Create XML
            var createArticle = new TransformArtigo();
            var artigos       = createArticle.Create(conteudos);

            createArticle.CreateXML(artigos, xmlDir, basename);

            pipeline.ExtractOutput <ShowParserWarnings>($"{errors}/{basename}-parser-errors.pdf");

            pipeline.Done();

            var validator = new ProgramValidatorXML();

            validator.ValidateArticle(outputfolder);
        }
예제 #3
0
        public static void Validate(string basename, string inputfolder, string outputfolder)
        {
            var validator = new ProgramValidatorXML();

            validator.ValidateArticle($"{inputfolder}");
        }