←Select platform

Run Method

Summary

Runs the readers on their corresponding data elements, getting the results, and optionally performing actions (like redaction) when needed.

Syntax
C#
C++/CLI
Python
def Run(self,options): 

Parameters

document

Document in interest.

options

Run options containing the elements to perform processing on and, optionally, actions to run afterward.

Return Value

List of result sets. Each result set corresponds to an element set that was passed through the command.

Example

This example shows how to load and run analysis.

C#
using Leadtools; 
using Leadtools.Document.Analytics; 
using Leadtools.Document; 
using Leadtools.Document.Unstructured; 
using Leadtools.Document.Data; 
 
using Leadtools.Ocr; 
 
public void Sample() 
{ 
   // Initialize the OCR Engine 
   using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)) 
   { 
      // Load the document to be analyzed 
      using (LEADDocument document = DocumentFactory.LoadFromFile(@"C:\Desktop\test.docx", new LoadDocumentOptions())) 
      { 
         document.Text.OcrEngine = ocrEngine; 
 
         // Initialize the Document Analyzer 
         var analyzer = new DocumentAnalyzer() 
         { 
            Reader = new UnstructuredDataReader(), 
            QueryContext = new FileRepositoryContext(@"C:\Desktop\test.json") 
         }; 
 
         // Initialize the Document Options 
         var options = new DocumentAnalyzerRunOptions() 
         { 
            ElementQuery = new RepositoryQuery() 
         }; 
 
         // Create the list of results 
         List<ElementSetResult> results = analyzer.Run(document, options); 
 
         string resultsMessage = string.Empty; 
 
         // Parse the results and output text to console 
         foreach (ElementSetResult result in results) 
            foreach (ElementResult item in result.Items) 
               Console.Write($"{(item.Value)} "); 
      } 
   } 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Analytics Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.