public class TextCleaner extends java.lang.Object implements TextProcessor
| Constructor and Description |
|---|
TextCleaner(java.util.function.Function<java.lang.Character,java.lang.Boolean> condition)
Remove a character if it meets the condition supplied.
|
TextCleaner(java.util.function.Function<java.lang.Character,java.lang.Boolean> condition,
char replace)
Replace a character if it meets the condition supplied.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String> |
preprocess(java.util.List<java.lang.String> tokens)
Applies the preprocessing defined to the given input tokens.
|
public TextCleaner(java.util.function.Function<java.lang.Character,java.lang.Boolean> condition)
condition - lambda function that defines whether a character meets conditionpublic TextCleaner(java.util.function.Function<java.lang.Character,java.lang.Boolean> condition,
char replace)
condition - lambda function that defines whether a character meets conditionreplace - the character to replacepublic java.util.List<java.lang.String> preprocess(java.util.List<java.lang.String> tokens)
preprocess in interface TextProcessortokens - the tokens created after the input text is tokenized