Module NewOCR
Class BasicSimilarityRule
- java.lang.Object
-
- com.uddernetworks.newocr.recognition.similarity.rules.BasicSimilarityRule
-
- All Implemented Interfaces:
SimilarRule
- Direct Known Subclasses:
DotSimilarityRule
,HorizontalLineSimilarityRule
,PercentDotSimilarityRule
,VerticalLineSimilarityRule
public class BasicSimilarityRule extends java.lang.Object implements SimilarRule
- Since:
- April 25, 2019
-
-
Constructor Summary
Constructors Constructor Description BasicSimilarityRule(java.lang.String name, Letter... characters)
BasicSimilarityRule(java.lang.String name, java.util.Set<Letter> characters)
-
Method Summary
Modifier and Type Method Description BasicSimilarityRule
addLetter(Letter letter)
java.lang.String
getName()
Gets the name of the rule.boolean
matchesLetter(ImageLetter first)
Gets if the current rule matches with the givenImageLetter
and is allowed to be processed.boolean
matchesLetter(Letter first)
Gets if the current rule matches with the givenImageLetter
and is allowed to be processed.void
removeLetter(Letter letter)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.uddernetworks.newocr.recognition.similarity.SimilarRule
process
-
-
-
-
Method Detail
-
addLetter
public BasicSimilarityRule addLetter(Letter letter)
-
removeLetter
public void removeLetter(Letter letter)
-
getName
public java.lang.String getName()
Description copied from interface:SimilarRule
Gets the name of the rule.- Specified by:
getName
in interfaceSimilarRule
- Returns:
- The name of the rule
-
matchesLetter
public boolean matchesLetter(ImageLetter first)
Description copied from interface:SimilarRule
Gets if the current rule matches with the givenImageLetter
and is allowed to be processed.- Specified by:
matchesLetter
in interfaceSimilarRule
- Parameters:
first
- The firstImageLetter
of the data- Returns:
- If the given
ImageLetter
can be processed by the current rule
-
matchesLetter
public boolean matchesLetter(Letter first)
Description copied from interface:SimilarRule
Gets if the current rule matches with the givenImageLetter
and is allowed to be processed.- Specified by:
matchesLetter
in interfaceSimilarRule
- Parameters:
first
- The firstLetter
of the data- Returns:
- If the given
Letter
can be processed by the current rule
-
-