public class ParsingResult extends Object
There are recognized data for each data field, messages for unrecognized data field (if it wasn't recognized due to some error) and some stats: number of correctly recognized data fields, number of data fields recognized with warnings and number of data fields recognized with errors.
Constructor and Description |
---|
ParsingResult(com.duallab.pdf2data.template.Template template, Map<String,List<List |
Modifier and Type | Method and Description |
---|---|
Map<String,List<List<ResultElement>>> |
getAllResults()
Returns a map with recognition results.
|
int |
getCorrectNumber()
Returns a number of data fields that were recognized correctly.
|
int |
getErrorsNumber()
Returns a number of data fields that were recognized with errors.
|
ResultImage |
getFirstResultAsImage(String dataFieldName)
Checks if recognized elements for specified datafield are images and returns first of them.
|
ResultTable |
getFirstResultAsTable(String dataFieldName)
Checks if recognized elements for specified data field are tables and returns first of them.
|
ResultText |
getFirstResultAsText(String dataFieldName)
Checks if recognized elements for specified datafield aren't tables and returns first of them.
|
String |
getMessage(String dataFieldName)
Return an error or warning message for datafield.
|
List<ResultElement> |
getResults(String dataFieldName)
Returns list of recognized objects.
|
int |
getWarningsNumber()
Returns a number of data fields that were recognized with warnings.
|
void |
saveToXML(OutputStream xmlOutputStream)
Saves parsing results to output stream in xml form.
|
void |
saveToXML(OutputStream xmlOutputStream, RecognitionProperties properties)
Saves parsing results to output stream in xml form.
|
void |
saveToXML(String outputXML)
Saves parsing results to xml file.
|
void |
saveToXML(String outputXML, RecognitionProperties properties)
Saves parsing results to xml file.
|
public String getMessage(String dataFieldName)
dataFieldName
- datafield name
public void saveToXML(String outputXML)
outputXML
- path to xml file
public void saveToXML(String outputXML, RecognitionProperties properties)
outputXML
- path to xml file
properties
- a RecognitionProperties
instance
public void saveToXML(OutputStream xmlOutputStream)
xmlOutputStream
- output stream
public void saveToXML(OutputStream xmlOutputStream, RecognitionProperties properties)
xmlOutputStream
- output stream
properties
- a RecognitionProperties
instance
public List<ResultElement> getResults(String dataFieldName)
dataFieldName
- data field name
public Map<String,List<List<ResultElement>>> getAllResults()
public ResultTable getFirstResultAsTable(String dataFieldName)
dataFieldName
- data field name
ClassCastException
- if results for specified datafield aren't tables
public ResultImage getFirstResultAsImage(String dataFieldName)
dataFieldName
- datafield name
ClassCastException
- if results for specified datafield aren't images
public ResultText getFirstResultAsText(String dataFieldName)
dataFieldName
- datafield name
ClassCastException
- if results for specified datafield are tables
public int getWarningsNumber()
public int getErrorsNumber()
public int getCorrectNumber()
Copyright © 2019. All rights reserved.