Files for dotnet framework / EAF

This commit is contained in:
2022-03-08 17:39:25 -07:00
parent 5475392c3f
commit f1bac2f5a7
13 changed files with 744 additions and 333 deletions

View File

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.Json;
namespace Adaptation.FileHandlers.jpeg;
@ -39,6 +40,29 @@ public class FileRead : Shared.FileRead, IFileRead
throw new Exception(cellInstanceConnectionName);
foreach (ModelObjectParameterDefinition modelObjectParameterDefinition in reactors)
_Reactors.Add(modelObjectParameterDefinition.Name.Split('.')[1], modelObjectParameterDefinition.Value);
string entryAssemblyLocationDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
string x86 = Path.Combine(entryAssemblyLocationDirectory, "x86");
if (!Directory.Exists(x86))
_ = Directory.CreateDirectory(x86);
string tessdata = Path.Combine(entryAssemblyLocationDirectory, "tessdata");
if (!Directory.Exists(tessdata))
_ = Directory.CreateDirectory(tessdata);
string pdfttfSource = Path.Combine(entryAssemblyLocationDirectory, "pdf.ttf");
string pdfttfDestination = Path.Combine(tessdata, Path.GetFileName(pdfttfSource));
if (File.Exists(pdfttfSource) && !File.Exists(pdfttfDestination))
File.Copy(pdfttfSource, pdfttfDestination);
string tesseract41dllSource = Path.Combine(entryAssemblyLocationDirectory, "tesseract41.dll");
string tesseract41dllDestination = Path.Combine(x86, Path.GetFileName(tesseract41dllSource));
if (File.Exists(tesseract41dllSource) && !File.Exists(tesseract41dllDestination))
File.Copy(tesseract41dllSource, tesseract41dllDestination);
string engtraineddataSource = Path.Combine(entryAssemblyLocationDirectory, "eng.traineddata");
string engtraineddataDestination = Path.Combine(tessdata, Path.GetFileName(engtraineddataSource));
if (File.Exists(engtraineddataSource) && !File.Exists(engtraineddataDestination))
File.Copy(engtraineddataSource, engtraineddataDestination);
string leptonica1800dllSource = Path.Combine(entryAssemblyLocationDirectory, "leptonica-1.80.0.dll");
string leptonica1800dllDestination = Path.Combine(x86, Path.GetFileName(leptonica1800dllSource));
if (File.Exists(leptonica1800dllSource) && !File.Exists(leptonica1800dllDestination))
File.Copy(leptonica1800dllSource, leptonica1800dllDestination);
}
void IFileRead.Move(Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResults, Exception exception) => Move(extractResults, exception);