moj.ri.weighting
Class MangesWS

java.lang.Object
  extended by moj.ri.weighting.WeightingScheme
      extended by moj.ri.weighting.MangesWS
All Implemented Interfaces:
java.io.Serializable

public class MangesWS
extends WeightingScheme

Calculates the weighting based upon the distance to the current label in the following manner: weight=(2^(1-distance to focus word)).

Version:
2006-Apr-05
Author:
Martin Hassel
See Also:
Serialized Form

Constructor Summary
MangesWS()
           
 
Method Summary
 float[] applyLeftWeighting(RandomLabel focusLabel, int distance, RandomLabel leftContextLabel)
          Calculates the weight based upon the distance (in the left context) to the current label in the following manner: weight=(2^(1-distance to focus word)).
 float[] applyRightWeighting(RandomLabel focusLabel, int distance, RandomLabel rightContextLabel)
          Calculates the weight based upon the distance (in the right context) to the current label in the following manner: weight=(2^(1-distance to focus word)).
 
Methods inherited from class moj.ri.weighting.WeightingScheme
setIndex
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MangesWS

public MangesWS()
Method Detail

applyLeftWeighting

public float[] applyLeftWeighting(RandomLabel focusLabel,
                                  int distance,
                                  RandomLabel leftContextLabel)
Calculates the weight based upon the distance (in the left context) to the current label in the following manner: weight=(2^(1-distance to focus word)).

Specified by:
applyLeftWeighting in class WeightingScheme
Parameters:
focusLabel - RandomLabel in focus, i.e. the focus word whose context vector should be modified with the weighted RandomLabel in left context.
distance - leftward distance to the focus word (RandomLabel).
leftContextLabel - RandomLabel in left context at distance from the focus word, which can be used together with distance to calculate the weight.
Returns:
the context of the focus word modified according to the weighting scheme.

applyRightWeighting

public float[] applyRightWeighting(RandomLabel focusLabel,
                                   int distance,
                                   RandomLabel rightContextLabel)
Calculates the weight based upon the distance (in the right context) to the current label in the following manner: weight=(2^(1-distance to focus word)).

Specified by:
applyRightWeighting in class WeightingScheme
Parameters:
focusLabel - RandomLabel in focus, i.e. the focus word whose context vector should be modified with the weighted RandomLabel in right context.
distance - rightward distance to the focus word (RandomLabel).
rightContextLabel - RandomLabel in right context at distance from the focus word, which can be used together with distance to calculate the weight.
Returns:
the context of the focus word modified according to the weighting scheme.