Module NewOCR

Class MergeRule

    • Method Summary

      Modifier and Type Method Description
      abstract MergePriority getPriority()
      Gets the priority of the current rule
      abstract boolean isHorizontal()
      Gets if the current merge rule is based on horizontally aligned letters (true) or vertically aligned letters (true).
      abstract java.util.Optional<java.util.List<ImageLetter>> mergeCharacters​(ImageLetter target, java.util.List<ImageLetter> letterData)
      Preforms the merging action with the current rule against the given data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isHorizontal

        public abstract boolean isHorizontal()
        Gets if the current merge rule is based on horizontally aligned letters (true) or vertically aligned letters (true).
        Returns:
        If the data given to mergeCharacters(ImageLetter, List) is horizontal (Full line) data
      • getPriority

        public abstract MergePriority getPriority()
        Gets the priority of the current rule
        Returns:
        The priority of the rule
      • mergeCharacters

        public abstract java.util.Optional<java.util.List<ImageLetter>> mergeCharacters​(ImageLetter target,
                                                                                        java.util.List<ImageLetter> letterData)
        Preforms the merging action with the current rule against the given data. If isHorizontal() is true, the given data will be a full line of data. If it returns false, the data will be all characters with a horizontal overlap in a column.
        Parameters:
        target - The base charcater
        letterData - The letter data
        Returns:
        The ImageLetter that should be removed if the merge was successful