- java.lang.Object
-
- com.uddernetworks.newocr.recognition.mergence.MergeRule
-
- com.uddernetworks.newocr.recognition.mergence.rules.ApostropheMergeRule
-
public class ApostropheMergeRule extends MergeRule
Merges pieces of apostrophes.- Since:
- April 25, 2019
-
-
Field Summary
-
Fields inherited from class com.uddernetworks.newocr.recognition.mergence.MergeRule
databaseManager, similarityManager
-
-
Constructor Summary
Constructors Constructor Description ApostropheMergeRule(DatabaseManager databaseManager, SimilarityManager similarityManager)
-
Method Summary
Modifier and Type Method Description MergePrioritygetPriority()Gets the priority of the current rulebooleanisHorizontal()Gets if the current merge rule is based on horizontally aligned letters (true) or vertically aligned letters (true).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.
-
-
-
Constructor Detail
-
ApostropheMergeRule
public ApostropheMergeRule(DatabaseManager databaseManager, SimilarityManager similarityManager)
-
-
Method Detail
-
isHorizontal
public boolean isHorizontal()
Description copied from class:MergeRuleGets if the current merge rule is based on horizontally aligned letters (true) or vertically aligned letters (true).- Specified by:
isHorizontalin classMergeRule- Returns:
- If the data given to
MergeRule.mergeCharacters(ImageLetter, List)is horizontal (Full line) data
-
getPriority
public MergePriority getPriority()
Description copied from class:MergeRuleGets the priority of the current rule- Specified by:
getPriorityin classMergeRule- Returns:
- The priority of the rule
-
mergeCharacters
public java.util.Optional<java.util.List<ImageLetter>> mergeCharacters(ImageLetter target, java.util.List<ImageLetter> letterData)
Description copied from class:MergeRulePreforms the merging action with the current rule against the given data. IfMergeRule.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.- Specified by:
mergeCharactersin classMergeRule- Parameters:
target- The base charcaterletterData- The letter data- Returns:
- The
ImageLetterthat should be removed if the merge was successful
-
-