public class CompositeLocalGlobalTermWeighter extends AbstractCloneableSerializable implements Evaluator<Vector,Vector>
Modifier and Type | Field and Description |
---|---|
protected GlobalTermWeighter |
globalWeighter
The weighting scheme for the global weights.
|
protected LocalTermWeighter |
localWeighter
The weighting scheme for the local weights.
|
protected TermWeightNormalizer |
normalizer
The weight normalizer.
|
Constructor and Description |
---|
CompositeLocalGlobalTermWeighter()
Creates a new
CompositeLocalGlobalTermWeighter . |
CompositeLocalGlobalTermWeighter(LocalTermWeighter localWeighter,
GlobalTermWeighter globalWeighter,
TermWeightNormalizer normalizer)
Creates a new
CompositeLocalGlobalTermWeighter with the given
weighting schemes. |
Modifier and Type | Method and Description |
---|---|
CompositeLocalGlobalTermWeighter |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
Vector |
evaluate(Vector document)
Evaluates the function on the given input and returns the output.
|
GlobalTermWeighter |
getGlobalWeighter()
Gets the weighting scheme for the global weights.
|
LocalTermWeighter |
getLocalWeighter()
Gets the weighting scheme for the local weights.
|
TermWeightNormalizer |
getNormalizer()
Gets the weight normalizer.
|
void |
setGlobalWeighter(GlobalTermWeighter globalWeighter)
Sets the weighting scheme for the global weights.
|
void |
setLocalWeighter(LocalTermWeighter localWeighter)
Sets the weighting scheme for the local weights.
|
void |
setNormalizer(TermWeightNormalizer normalizer)
Sets the weight normalizer.
|
protected LocalTermWeighter localWeighter
protected GlobalTermWeighter globalWeighter
protected TermWeightNormalizer normalizer
public CompositeLocalGlobalTermWeighter()
CompositeLocalGlobalTermWeighter
. All of the
weightings default to null.public CompositeLocalGlobalTermWeighter(LocalTermWeighter localWeighter, GlobalTermWeighter globalWeighter, TermWeightNormalizer normalizer)
CompositeLocalGlobalTermWeighter
with the given
weighting schemes.localWeighter
- The weighting scheme for local weights. Null means that the input
values are not changed.globalWeighter
- The weighting scheme for the global weights. Null means that no
global weights are used.normalizer
- The normalization scheme for the weights. Null means that no
normalization is used.public CompositeLocalGlobalTermWeighter clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public Vector evaluate(Vector document)
Evaluator
public LocalTermWeighter getLocalWeighter()
public void setLocalWeighter(LocalTermWeighter localWeighter)
localWeighter
- The weighting scheme for the local weights. Null means no local
weights.public GlobalTermWeighter getGlobalWeighter()
public void setGlobalWeighter(GlobalTermWeighter globalWeighter)
globalWeighter
- The weighting scheme for the global weights. Null means no global
weights.public TermWeightNormalizer getNormalizer()
public void setNormalizer(TermWeightNormalizer normalizer)
normalizer
- The weight normalizer. Null means no normalizer.