Package cz.vutbr.fit.layout.text.taggers
Class IntegerTagger
- java.lang.Object
-
- cz.vutbr.fit.layout.impl.BaseService
-
- cz.vutbr.fit.layout.impl.BaseParametrizedOperation
-
- cz.vutbr.fit.layout.text.taggers.BaseTagger
-
- cz.vutbr.fit.layout.text.taggers.IntegerTagger
-
- All Implemented Interfaces:
ParametrizedOperation,Service,Tagger
public abstract class IntegerTagger extends BaseTagger
- Author:
- burgetr
-
-
Constructor Summary
Constructors Constructor Description IntegerTagger(int min, int max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsContinuation(Area node)booleanallowsJoining()floatbelongsTo(Area node)List<TagOccurrence>extract(String src)StringgetDescription()intgetMax()intgetMin()protected PatterngetNumExpr()booleanisAllowsLeadingZero()booleanmayCoexistWith(Tag other)voidsetAllowsLeadingZero(boolean allowsLeadingZero)protected booleanvalidateMatch(String srcString, String substring, int matchStart, int matchEnd)Validates the substring match -- checks the neighborhood and numeric range.protected booleanvalidateRange(int value)-
Methods inherited from class cz.vutbr.fit.layout.text.taggers.BaseTagger
getCategory, isHomogeneous, toString
-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseParametrizedOperation
defineParams, getParam, getParams, getParamString, setParam
-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseService
getServiceManager, setServiceManager
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cz.vutbr.fit.layout.api.ParametrizedOperation
getParam, getParams, getParamString, setParam
-
Methods inherited from interface cz.vutbr.fit.layout.api.Service
getId, getName, setServiceManager
-
-
-
-
Method Detail
-
getMin
public int getMin()
-
getMax
public int getMax()
-
isAllowsLeadingZero
public boolean isAllowsLeadingZero()
-
setAllowsLeadingZero
public void setAllowsLeadingZero(boolean allowsLeadingZero)
-
getDescription
public String getDescription()
-
belongsTo
public float belongsTo(Area node)
-
allowsContinuation
public boolean allowsContinuation(Area node)
-
allowsJoining
public boolean allowsJoining()
-
mayCoexistWith
public boolean mayCoexistWith(Tag other)
-
extract
public List<TagOccurrence> extract(String src)
-
validateMatch
protected boolean validateMatch(String srcString, String substring, int matchStart, int matchEnd)
Validates the substring match -- checks the neighborhood and numeric range. This may be overriden for particular use cases.- Parameters:
srcString- the whole source stringsubstring- the matched substringmatchStart- start index of the substring in the whole stringmatchEnd- end index of the substring in the whole string- Returns:
- true when the match corresponds to the number range and other limitations
-
validateRange
protected boolean validateRange(int value)
-
getNumExpr
protected Pattern getNumExpr()
-
-