com.aspose.ocr

Class RecognitionResult



  • public class RecognitionResult
    extends Object
    The results of the image recognition. Contains elements with recognition information and methods for result export.
    • Field Detail

      • recognitionAreasText

        public ArrayList<String> recognitionAreasText
        List recognition results of a list of areas (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
        List recognition results of a list of areas (Rectangles).
      • warnings

        public ArrayList<String> warnings
        Gets or sets list of the warnings messages describing non-critical faults appeared during generation.
    • Constructor Detail

      • RecognitionResult

        public RecognitionResult()
        Initializes a new instance of the
        See Also:
        class.
    • Method Detail

      • GetJson

        public String GetJson()
        Form JSON string with recognition results.
        Returns:
        Recognition results as JSON string.
      • save

        public void save(String fullFileName)
        Saves the document in the plain text
        Parameters:
        fullFileName - Filename with a path for saving recognition result
      • save

        public void save(String fullFileName,
                         Format format)
        Saves the document in the plain text or Microsoft Word Text Document format.
        Parameters:
        fullFileName - Filename with a path for saving recognition result
        format - Document format enum type of Format.
      • saveSpellCheckCorrectedText

        public void saveSpellCheckCorrectedText(String fullFileName,
                                                Format format,
                                                SpellCheckLanguage language)
        Saves the corrected text in the document in the plain text or Microsoft Word Text Document format.
        Parameters:
        fullFileName - Filename with a path for saving recognition result
        format - Document format enum type of Format.
        language - Dictionary for spell check
      • saveSpellCheckCorrectedText

        public void saveSpellCheckCorrectedText(String fullFileName,
                                                Format format)
        Saves the corrected text in the document in the plain text or Microsoft Word Text Document format.
        Parameters:
        fullFileName - Filename with a path for saving recognition result
        format - Document format enum type of Format.
      • getSpellCheckCorrectedText

        public String getSpellCheckCorrectedText(SpellCheckLanguage language)
        Corrects text (replaces misspelled words).
        Parameters:
        language - Dictionary to use.
        Returns:
        Corrected recognition results string.
      • getSpellCheckCorrectedText

        public String getSpellCheckCorrectedText()
        Corrects text (replaces misspelled words).
        Returns:
        Corrected recognition results string. Default English dictionary.
      • getSpellCheckErrorList

        public List<SpellCheckError> getSpellCheckErrorList(SpellCheckLanguage language)
        Find the misspelled words with suggested spellings for a given input text.
        Parameters:
        language - Dictionary to use.
        Returns:
        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<SpellCheckError> getSpellCheckErrorList()
        Find the misspelled words with suggested spellings for a given input text. Default English dictionary.
        Returns:
        ArrayList of SpellCheckError object representing misspelled words with lists suggested correct spellings for the each misspelled word, and with the edit distance.
      • useUserDictionary

        public void useUserDictionary(String dictionaryPath)
        Allows to use own dictionary for spell-check correction.
        Parameters:
        dictionaryPath - Full 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.