Loading SimpleOCRCLI/Other/Resources/TestCoverageBadges/badge_shieldsio_linecoverage_blue.svg +1 −1 Original line number Diff line number Diff line <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="96" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h61v20H0z"/><path fill="#0374B5" d="M61 0h35v20H61z"/><path fill="url(#b)" d="M0 0h96v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">coverage</text><text x="315" y="140" transform="scale(.1)" textLength="510">coverage</text><text x="775" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">56%</text><text x="775" y="140" transform="scale(.1)" textLength="250">56%</text></g></svg> No newline at end of file <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="96" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h61v20H0z"/><path fill="#0374B5" d="M61 0h35v20H61z"/><path fill="url(#b)" d="M0 0h96v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">coverage</text><text x="315" y="140" transform="scale(.1)" textLength="510">coverage</text><text x="775" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">48%</text><text x="775" y="140" transform="scale(.1)" textLength="250">48%</text></g></svg> No newline at end of file SimpleOCRCLI/SimpleOCRCLI/Helper/VerbVisitor.cs +3 −2 Original line number Diff line number Diff line Loading @@ -12,13 +12,14 @@ namespace SimpleOCR.CLI.Core.Helper public int Handle(OCRAnalysisVerb runWithOptionsFromCLI) { this.RunBase = new RunWithArgumentsFromCLI(runWithOptionsFromCLI); this.RunBase = new RunOCRAnalysis(runWithOptionsFromCLI); return this.RunBase.Run(); } public int Handle(DownloadOCRDataVerb downloadOCRData) { throw new System.NotImplementedException(); this.RunBase = new RunDownloader(downloadOCRData); return this.RunBase.Run(); } } } SimpleOCRCLI/SimpleOCRCLI/Runner/RunDownloader.cs +1 −8 Original line number Diff line number Diff line using GRYLibrary.Core.Logging.GeneralPurposeLogger; using SimpleOCR.CLI.Core.Verbs; using SimpleOCR.Library.Core.FileTypes; using SimpleOCR.Library.Core.Visitors; using SimpleOCR.Library.Core.VIsitors; using System; using System.Collections.Generic; using System.IO; using System.Text; namespace SimpleOCR.CLI.Core.Runner { Loading @@ -21,7 +14,7 @@ namespace SimpleOCR.CLI.Core.Runner protected override string RunImplementation() { SimpleOCR.Library.Core.IOCRService ocrService = new SimpleOCR.Library.Core.OCRService(new SimpleOCR.Library.Core.OCRServiceConfiguration() { DataFolder = this._Options.TargetFolder}, GeneralLogger.CreateUsingConsole()); ocrService.Download(); ocrService.DownloadOCRData(); return string.Empty; } } Loading SimpleOCRCLI/SimpleOCRCLI/Runner/RunOCRAnalysis.cs +2 −2 Original line number Diff line number Diff line using GRYLibrary.Core.Logging.GeneralPurposeLogger; using SimpleOCR.CLI.Core.Verbs; using SimpleOCR.Library.Core.FileTypes; using SimpleOCR.Library.Core.VIsitors; using SimpleOCR.Library.Core.Visitors; using System; using System.Collections.Generic; using System.IO; Loading @@ -23,7 +23,7 @@ namespace SimpleOCR.CLI.Core.Runner ocrService.Initialize(); (FileType fileType, byte[] content, string mimeType) = SimpleOCR.Library.Core.Misc.Utilities.LoadFile(_Options.File); content = fileType.Accept(new ToPictureVisitor(content, mimeType)); string result = ocrService.GetOCRContent(content, new HashSet<string>(this._Options.Languages)); string result = ocrService.GetOCRContent(content, mimeType, new HashSet<string>(this._Options.Languages)); if(this._Options.Outputfile == null) { Console.WriteLine(result); Loading SimpleOCRCLI/SimpleOCRCLI/SimpleOCRCLI.csproj +2 −2 Original line number Diff line number Diff line Loading @@ -58,12 +58,12 @@ <ErrorReport>none</ErrorReport> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" /> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.4" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="10.0.1" /> <PackageReference Include="CommandLineParser" Version="2.9.1" /> <PackageReference Include="GRYLibrary" Version="1.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.1" /> <PackageReference Include="Tesseract" Version="5.2.0" /> <Reference Include="SimpleOCRLibrary"> <HintPath>..\Other\Resources\DependentCodeUnits\SimpleOCRLibrary\BuildResult_DotNet_win-x64\SimpleOCRLibrary.dll</HintPath> Loading Loading
SimpleOCRCLI/Other/Resources/TestCoverageBadges/badge_shieldsio_linecoverage_blue.svg +1 −1 Original line number Diff line number Diff line <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="96" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h61v20H0z"/><path fill="#0374B5" d="M61 0h35v20H61z"/><path fill="url(#b)" d="M0 0h96v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">coverage</text><text x="315" y="140" transform="scale(.1)" textLength="510">coverage</text><text x="775" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">56%</text><text x="775" y="140" transform="scale(.1)" textLength="250">56%</text></g></svg> No newline at end of file <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="96" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h61v20H0z"/><path fill="#0374B5" d="M61 0h35v20H61z"/><path fill="url(#b)" d="M0 0h96v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">coverage</text><text x="315" y="140" transform="scale(.1)" textLength="510">coverage</text><text x="775" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">48%</text><text x="775" y="140" transform="scale(.1)" textLength="250">48%</text></g></svg> No newline at end of file
SimpleOCRCLI/SimpleOCRCLI/Helper/VerbVisitor.cs +3 −2 Original line number Diff line number Diff line Loading @@ -12,13 +12,14 @@ namespace SimpleOCR.CLI.Core.Helper public int Handle(OCRAnalysisVerb runWithOptionsFromCLI) { this.RunBase = new RunWithArgumentsFromCLI(runWithOptionsFromCLI); this.RunBase = new RunOCRAnalysis(runWithOptionsFromCLI); return this.RunBase.Run(); } public int Handle(DownloadOCRDataVerb downloadOCRData) { throw new System.NotImplementedException(); this.RunBase = new RunDownloader(downloadOCRData); return this.RunBase.Run(); } } }
SimpleOCRCLI/SimpleOCRCLI/Runner/RunDownloader.cs +1 −8 Original line number Diff line number Diff line using GRYLibrary.Core.Logging.GeneralPurposeLogger; using SimpleOCR.CLI.Core.Verbs; using SimpleOCR.Library.Core.FileTypes; using SimpleOCR.Library.Core.Visitors; using SimpleOCR.Library.Core.VIsitors; using System; using System.Collections.Generic; using System.IO; using System.Text; namespace SimpleOCR.CLI.Core.Runner { Loading @@ -21,7 +14,7 @@ namespace SimpleOCR.CLI.Core.Runner protected override string RunImplementation() { SimpleOCR.Library.Core.IOCRService ocrService = new SimpleOCR.Library.Core.OCRService(new SimpleOCR.Library.Core.OCRServiceConfiguration() { DataFolder = this._Options.TargetFolder}, GeneralLogger.CreateUsingConsole()); ocrService.Download(); ocrService.DownloadOCRData(); return string.Empty; } } Loading
SimpleOCRCLI/SimpleOCRCLI/Runner/RunOCRAnalysis.cs +2 −2 Original line number Diff line number Diff line using GRYLibrary.Core.Logging.GeneralPurposeLogger; using SimpleOCR.CLI.Core.Verbs; using SimpleOCR.Library.Core.FileTypes; using SimpleOCR.Library.Core.VIsitors; using SimpleOCR.Library.Core.Visitors; using System; using System.Collections.Generic; using System.IO; Loading @@ -23,7 +23,7 @@ namespace SimpleOCR.CLI.Core.Runner ocrService.Initialize(); (FileType fileType, byte[] content, string mimeType) = SimpleOCR.Library.Core.Misc.Utilities.LoadFile(_Options.File); content = fileType.Accept(new ToPictureVisitor(content, mimeType)); string result = ocrService.GetOCRContent(content, new HashSet<string>(this._Options.Languages)); string result = ocrService.GetOCRContent(content, mimeType, new HashSet<string>(this._Options.Languages)); if(this._Options.Outputfile == null) { Console.WriteLine(result); Loading
SimpleOCRCLI/SimpleOCRCLI/SimpleOCRCLI.csproj +2 −2 Original line number Diff line number Diff line Loading @@ -58,12 +58,12 @@ <ErrorReport>none</ErrorReport> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" /> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.4" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="10.0.1" /> <PackageReference Include="CommandLineParser" Version="2.9.1" /> <PackageReference Include="GRYLibrary" Version="1.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.1" /> <PackageReference Include="Tesseract" Version="5.2.0" /> <Reference Include="SimpleOCRLibrary"> <HintPath>..\Other\Resources\DependentCodeUnits\SimpleOCRLibrary\BuildResult_DotNet_win-x64\SimpleOCRLibrary.dll</HintPath> Loading