public class GeometricWeighting extends Object implements WeightingFunction
HyperspaceAnalogueToLanguage
instance should weigh co-occurrences based on
the word distance.Constructor and Description |
---|
GeometricWeighting() |
Modifier and Type | Method and Description |
---|---|
double |
weight(int positionOffset,
int windowSize)
Returns the weighed value where the closest words receive a weight equal
to the window size and the most distance words receive a weight of
1 , using a geometric (1 / 2n) decrease for in-between values. |
public double weight(int positionOffset, int windowSize)
1
, using a geometric (1 / 2n) decrease for in-between values.weight
in interface WeightingFunction
positionOffset
- the location of the word relative to the current
positionwindowSize
- the maximum nubmer of words on one side that will be
considered for weightingCopyright © 2012. All Rights Reserved.