Example #1
0
        public IActionResult ProcessFile([FromForm(Name = "uploadedFile")] IFormFile formFile)
        {
            IndexedDocument document;

            using (var stream = formFile.OpenReadStream())
            {
                document = indexer.ProcessDocument(formFile.FileName, stream);
            }

            var result = similarityDetectionAlgorithm.GetScore(document, DetectionStrategy.ByPhrase);

            TempData["resultModels"] = JsonConvert.SerializeObject(ResultModel.FromDictionary(result));
            return(RedirectToAction("CheckResults", "Home", routeValues: new { fileName = formFile.FileName }));
        }
Example #2
0
        public void ProvisionFromDirectory(DirectoryInfo directory)
        {
            var indexedFiles = directory.GetFiles().Select(file => indexer.ProcessDocument(file.FullName));

            luceneService.AddDocuments(indexedFiles);
        }