Package it.unimi.di.big.mg4j.index
Class DowncaseTermProcessor
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.DowncaseTermProcessor
-
- All Implemented Interfaces:
TermProcessor,FlyweightPrototype<TermProcessor>,Serializable
public class DowncaseTermProcessor extends Object implements TermProcessor
A term processor downcasing all characters.- See Also:
- Serialized Form
-
-
Method Summary
Modifier and Type Method Description DowncaseTermProcessorcopy()static TermProcessorgetInstance()booleanprocessPrefix(MutableString prefix)Processes the given prefix, leaving the result in the same mutable string.booleanprocessTerm(MutableString term)Processes the given term, leaving the result in the same mutable string.StringtoString()
-
-
-
Method Detail
-
getInstance
public static final TermProcessor getInstance()
-
processTerm
public boolean processTerm(MutableString term)
Description copied from interface:TermProcessorProcesses the given term, leaving the result in the same mutable string.- Specified by:
processTermin interfaceTermProcessor- Parameters:
term- a mutable string containing the term to be processed, ornull.- Returns:
- true if the term is not
nulland should be indexed, false otherwise.
-
processPrefix
public boolean processPrefix(MutableString prefix)
Description copied from interface:TermProcessorProcesses the given prefix, leaving the result in the same mutable string.This method is not used during the indexing phase, but rather at query time. If the user wants to specify a prefix query, it is sometimes necessary to transform the prefix (e.g., processPrefix(MutableString) downcasing it).
It is of course unlikely that this method returns false, as it is usually not possible to foresee which are the prefixes of indexable words. In case no natural transformation applies, this method should leave its argument unchanged.
- Specified by:
processPrefixin interfaceTermProcessor- Parameters:
prefix- a mutable string containing a prefix to be processed, ornull.- Returns:
- true if the prefix is not
nulland there might be an indexed word starting withprefix, false otherwise.
-
copy
public DowncaseTermProcessor copy()
- Specified by:
copyin interfaceFlyweightPrototype<TermProcessor>- Specified by:
copyin interfaceTermProcessor
-
-