public TesseractHelper(string tessdataPath, string mediaPath) { TessdataPath = tessdataPath; MediaPath = mediaPath; Backend = new IngredientListBackend(TessdataPath); Backend.list = new IngredientListModel(); }
public IngredientListController() { //var controller = new HomeController(); //tessdataPath = controller.GetTessdataPath(); //mediaPath = controller.GetMediaPath(); tessdataPath = System.Web.HttpContext.Current.Request.MapPath("~\\tessdata"); backend = new IngredientListBackend(tessdataPath); }
public DataCleanFacadeTest() { // Set tessdata path var curentDirectoryPathArray = Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()).Split('\\'); var tessdataArray = curentDirectoryPathArray.Take((int)curentDirectoryPathArray.Count() - 2).Append("Is This Vegan (Net)\\tessdata"); var tessdataPath = string.Join("\\", tessdataArray); // Set Media directory path var temporaryGeneralTestImagePathArray = curentDirectoryPathArray.Take((int)curentDirectoryPathArray.Count() - 2).Append("Is This Vegan Test\\Media\\"); mediaPath = string.Join("\\", temporaryGeneralTestImagePathArray); backend = new IngredientListBackend(tessdataPath); }
public IngredientListHelperTest() { // Get path to current directory var curentDirectoryPathArray = Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()).Split('\\'); // Remove last two directories (bin and this project) and add directories for API project and tessdata var tessdataArray = curentDirectoryPathArray.Take((int)curentDirectoryPathArray.Count() - 2).Append("Is This Vegan (Net)\\tessdata"); // Join to form valid string path var tessdataPath = string.Join("\\", tessdataArray); // Set general test image path var temporaryGeneralMediaFolderPathArray = curentDirectoryPathArray.Take((int)curentDirectoryPathArray.Count() - 2).Append("Is This Vegan Test\\Media\\"); mediaFolderPath = string.Join("\\", temporaryGeneralMediaFolderPathArray); backend = new IngredientListBackend(tessdataPath); helper = new IngredientListHelper(); }
/// <summary> /// Resets IngredientListBackend class properties that would be changed as a result of text extraction. /// </summary> public void BackendReset(IngredientListBackend backend) { backend.list = null; backend.extraction = null; backend.exception = null; }