RecognitionResult

Inheritance: java.lang.Object

public class RecognitionResult

The results of the image recognition. Contains elements with recognition information and methods for result export.

Constructors

ConstructorDescription
RecognitionResult()Initializes a new instance of the

Fields

FieldDescription
recognitionAreasTextList recognition results of a list of areas (Rectangles).
recognitionLinesResultGets a list of recognition results with a list of rows (Rectangles).
recognitionTextRecognition result of all page or one area.
recognitionAreasRectanglesList recognition results of a list of areas (Rectangles).
recognitionCharactersListA set of characters found by the recognition algorithm and arranged in descending order of probability.
skewSkew angle of the image.
warningsGets or sets list of the warnings messages describing non-critical faults appeared during generation.

Methods

MethodDescription
GetJson()Form JSON string with recognition results.
GetXml()Form JSON string with recognition results.
save(String fullFileName)Saves the document in the plain text
save(String fullFileName, Format format)Saves the document in the plain text or other document format.
saveSpellCheckCorrectedText(String fullFileName, Format format, SpellCheck.SpellCheckLanguage language)Saves the corrected text in the document in the plain text or other format.
saveSpellCheckCorrectedText(String fullFileName, Format format)Saves the corrected with English dictionary text in the document in the plain text or Microsoft Word Text Document format.
getSpellCheckCorrectedText(SpellCheck.SpellCheckLanguage language)Corrects text (replaces misspelled words).
getSpellCheckCorrectedText()Corrects text (replaces misspelled words).
getSpellCheckErrorList(SpellCheck.SpellCheckLanguage language)Find the misspelled words with suggested spellings for a given input text.
getSpellCheckErrorList()Find the misspelled words with suggested spellings for a given input text.
useUserDictionary(String dictionaryPath)Allows to use own dictionary for spell-check correction.
GetKeywords()Get keywords from pasport (Test mode.
SetKeyword(String key, RecognitionResult.LinesResult result)
add(RecognitionResult other)
clone()

RecognitionResult()

public RecognitionResult()

Initializes a new instance of the

recognitionAreasText

public ArrayList<String> recognitionAreasText

List recognition results of a list of areas (Rectangles).

recognitionLinesResult

public ArrayList<RecognitionResult.LinesResult> recognitionLinesResult

Gets a list of recognition results with a list of rows (Rectangles).

recognitionText

public String recognitionText

Recognition result of all page or one area.

recognitionAreasRectangles

public ArrayList<Rectangle> recognitionAreasRectangles

List recognition results of a list of areas (Rectangles).

recognitionCharactersList

public ArrayList<char[]> recognitionCharactersList

A set of characters found by the recognition algorithm and arranged in descending order of probability.

skew

public double skew

Skew angle of the image.

warnings

public ArrayList<String> warnings

Gets or sets list of the warnings messages describing non-critical faults appeared during generation.

GetJson()

public String GetJson()

Form JSON string with recognition results.

Returns: java.lang.String - Recognition results as JSON string.

GetXml()

public String GetXml()

Form JSON string with recognition results.

Returns: java.lang.String - Recognition results as XML string.

save(String fullFileName)

public void save(String fullFileName)

Saves the document in the plain text

Parameters:

ParameterTypeDescription
fullFileNamejava.lang.StringFilename with a path for saving recognition result

save(String fullFileName, Format format)

public void save(String fullFileName, Format format)

Saves the document in the plain text or other document format.

Parameters:

ParameterTypeDescription
fullFileNamejava.lang.StringFilename with a path for saving recognition result.
formatFormatDocument format enum type of Format.

saveSpellCheckCorrectedText(String fullFileName, Format format, SpellCheck.SpellCheckLanguage language)

public void saveSpellCheckCorrectedText(String fullFileName, Format format, SpellCheck.SpellCheckLanguage language)

Saves the corrected text in the document in the plain text or other format.

Parameters:

ParameterTypeDescription
fullFileNamejava.lang.StringFilename with a path for saving recognition result.
formatFormatDocument format enum type of Format.
languageSpellCheckLanguageDictionary for spell check.

saveSpellCheckCorrectedText(String fullFileName, Format format)

public void saveSpellCheckCorrectedText(String fullFileName, Format format)

Saves the corrected with English dictionary text in the document in the plain text or Microsoft Word Text Document format.

Parameters:

ParameterTypeDescription
fullFileNamejava.lang.StringFilename with a path for saving recognition result.
formatFormatDocument format enum type of Format.

getSpellCheckCorrectedText(SpellCheck.SpellCheckLanguage language)

public String getSpellCheckCorrectedText(SpellCheck.SpellCheckLanguage language)

Corrects text (replaces misspelled words).

Parameters:

ParameterTypeDescription
languageSpellCheckLanguageDictionary to use.

Returns: java.lang.String - Corrected recognition results string.

getSpellCheckCorrectedText()

public String getSpellCheckCorrectedText()

Corrects text (replaces misspelled words).

Returns: java.lang.String - Corrected recognition results string. Default English dictionary.

getSpellCheckErrorList(SpellCheck.SpellCheckLanguage language)

public List<SpellCheck.SpellCheckError> getSpellCheckErrorList(SpellCheck.SpellCheckLanguage language)

Find the misspelled words with suggested spellings for a given input text.

Parameters:

ParameterTypeDescription
languageSpellCheckLanguageDictionary to use.

Returns: java.util.List<com.aspose.ocr.SpellCheck.SpellCheckError> - ArrayList of SpellCheckError object representing misspelled words with lists suggested correct spellings for the each misspelled word, and with the edit distance.

getSpellCheckErrorList()

public List<SpellCheck.SpellCheckError> getSpellCheckErrorList()

Find the misspelled words with suggested spellings for a given input text. Default English dictionary.

Returns: java.util.List<com.aspose.ocr.SpellCheck.SpellCheckError> - ArrayList of SpellCheckError object representing misspelled words with lists suggested correct spellings for the each misspelled word, and with the edit distance.

useUserDictionary(String dictionaryPath)

public void useUserDictionary(String dictionaryPath)

Allows to use own dictionary for spell-check correction.

Parameters:

ParameterTypeDescription
dictionaryPathjava.lang.StringFull path to the user dictionary (frequency dictionary). Dictionary file format: Plain text file in UTF-8 encoding. Word and Word Frequency are separated by comma, the word is expected in the first column and the frequency in the second column. Every word-frequency-pair in a separate line.A line is defined as a sequence of characters followed by a line feed ("\n"), a carriage return ("\r"), or a carriage return immediately followed by a line feed("\r\n"). Every word is expected to be in lower case.

GetKeywords()

public HashMap<String,RecognitionResult.LinesResult> GetKeywords()

Get keywords from pasport (Test mode. Works only for USA and MADAGASCAR passports).

Returns: java.util.HashMap<java.lang.String,com.aspose.ocr.RecognitionResult.LinesResult> - Dictionary with keyword as a key and LinesResult as a value.

SetKeyword(String key, RecognitionResult.LinesResult result)

public void SetKeyword(String key, RecognitionResult.LinesResult result)

Parameters:

ParameterTypeDescription
keyjava.lang.String
resultLinesResult

add(RecognitionResult other)

public RecognitionResult add(RecognitionResult other)

Parameters:

ParameterTypeDescription
otherRecognitionResult

Returns: RecognitionResult

clone()

public RecognitionResult clone()

Returns: RecognitionResult