Index contruction requires sometimes modifications of the given terms: downcasing, stemming, and so on. The same transformation must be applied to terms in a query. This interface provides a uniform way to perform arbitrary term transformations.
Index construction requires also term filtering: {@link #processTerm(MutableString)} mayreturn false, indicating that the term should not be processed at all (e.g., because it is a stopword).
Additionally, the method {@link #processPrefix(MutableString)} mayprocess analogously a prefix (used for prefix queries).
Implementation are encouraged to expose a singleton, when possible, by means of the static factory method getInstance()
. Warning: implementations of this class are not required to be thread-safe, but they provide {@link it.unimi.dsi.lang.FlyweightPrototype flyweight copies}. The {@link #copy()} method is strengthened so to return a instance of this class.
This interface was originally suggested by Fabien Campagne.
|
|
|
|
|
|