예제 #1
0
 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);
 }
예제 #3
0
        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);
        }
예제 #4
0
        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();
        }
예제 #5
0
 /// <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;
 }