-
- All Known Implementing Classes:
AbstractTextFilter
,LengthFilter
,PunctuationFilter
,RegexFilter
,TextElementFilter
,WordFilter
public interface TextFilter
Interface for a text filter usable by the FilterText operator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TextContainer
filterText(TextContainer text)
Returns the tokenized text with the filtered tokens removed.boolean
filterText(String text)
Returns true if the specified String should be filtered.boolean
isInverted()
Returns true if the filter is inverted.boolean
isStringFilter()
Returns true if filter can be applied to a string.boolean
isTokenFilter()
Returns true if filter can be applied to tokenized text.void
setInverted(boolean invert)
Set whether this filter should be inverted.
-
-
-
Method Detail
-
isInverted
boolean isInverted()
Returns true if the filter is inverted.- Returns:
- true if filter is inverted
-
isStringFilter
boolean isStringFilter()
Returns true if filter can be applied to a string.- Returns:
- true if filter applies to strings
-
isTokenFilter
boolean isTokenFilter()
Returns true if filter can be applied to tokenized text.- Returns:
- true if filter applies to tokenized text
-
setInverted
void setInverted(boolean invert)
Set whether this filter should be inverted.- Parameters:
invert
- true if filter should be inverted
-
filterText
boolean filterText(String text)
Returns true if the specified String should be filtered.- Parameters:
text
- the string to test- Returns:
- true if the string should be filtered
-
filterText
TextContainer filterText(TextContainer text)
Returns the tokenized text with the filtered tokens removed.- Parameters:
text
- the tokenized text to filter- Returns:
- the filtered tokenized text
-
-