public class SynonymFilter extends AbstractSingleTermFilter
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<Term,Term> |
synonyms
The mapping of terms to the synonym to replace them with.
|
Constructor and Description |
---|
SynonymFilter()
Creates a new, empty
SynonymFilter . |
SynonymFilter(java.util.Map<Term,Term> synonyms)
Creates a new
SynonymFilter with the given synonyms. |
Modifier and Type | Method and Description |
---|---|
TermOccurrence |
filterTerm(TermOccurrence occurrence)
Takes a single term occurrence and filters that occurrence into a new
occurrence or returns null, indicating that the filter rejects that
term.
|
java.util.Map<Term,Term> |
getSynonyms()
Gets the mapping of terms to their synonyms.
|
void |
setSynonyms(java.util.Map<Term,Term> synonyms)
Sets the mapping of terms to their synonyms.
|
filterTerms
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
public TermOccurrence filterTerm(TermOccurrence occurrence)
SingleTermFilter
occurrence
- The term occurrence to filter.public java.util.Map<Term,Term> getSynonyms()