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
recognitionAreasRectanglesList recognition results of a list of areas (Rectangles).
recognitionAreasTextList recognition results of a list of areas (Rectangles).
recognitionCharactersListA set of characters found by the recognition algorithm and arranged in descending order of probability.
recognitionLinesResultGets a list of recognition results with a list of rows (Rectangles).
recognitionTextRecognition result of all page or one area.
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.
GetKeywords()Get keywords from pasport (Test mode.
GetXml()Form JSON string with recognition results.
SetKeyword(String key, RecognitionResult.LinesResult result)
add(RecognitionResult other)
clone()
equals(Object arg0)
getClass()
getSpellCheckCorrectedText()Corrects text (replaces misspelled words).
getSpellCheckCorrectedText(SpellCheck.SpellCheckLanguage language)Corrects text (replaces misspelled words).
getSpellCheckErrorList()Find the misspelled words with suggested spellings for a given input text.
getSpellCheckErrorList(SpellCheck.SpellCheckLanguage language)Find the misspelled words with suggested spellings for a given input text.
hashCode()
notify()
notifyAll()
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.
save(String fullFileName, Format format, PdfOptimizationMode optimizePdf)Saves the document in the plain text or other document 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.
saveSpellCheckCorrectedText(String fullFileName, Format format, SpellCheck.SpellCheckLanguage language)Saves the corrected text in the document in the plain text or other format.
toString()
useUserDictionary(String dictionaryPath)Allows to use own dictionary for spell-check correction.
wait()
wait(long arg0)
wait(long arg0, int arg1)

RecognitionResult()

public RecognitionResult()

Initializes a new instance of the

recognitionAreasRectangles

public ArrayList<Rectangle> recognitionAreasRectangles

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

recognitionAreasText

public ArrayList<String> recognitionAreasText

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.

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.

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.

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.

GetXml()

public String GetXml()

Form JSON string with recognition results.

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

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

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getSpellCheckCorrectedText()

public String getSpellCheckCorrectedText()

Corrects text (replaces misspelled words).

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

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.

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.

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.

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

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.

save(String fullFileName, Format format, PdfOptimizationMode optimizePdf)

public void save(String fullFileName, Format format, PdfOptimizationMode optimizePdf)

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.
optimizePdfPdfOptimizationModeReduce the PDF file size by lowering the quality of background images. By default, the original image quality is preserved.

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.

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.

toString()

public String toString()

Returns: java.lang.String

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.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int