annotation
Class MatchingStrategy

java.lang.Object
  extended by annotation.MatchingStrategy

public class MatchingStrategy
extends java.lang.Object

Responsible for computing similarity of context and gloss

Author:
Mateusz Kopec

Constructor Summary
MatchingStrategy(java.util.Map<java.lang.String,Gloss> preprocessedGlosses, java.lang.String params)
           
 
Method Summary
 double computeSimilarity(java.util.Map<java.lang.String,java.lang.Double> contextVector, java.lang.String senseId)
          Computes the similarity between context vector and chosen sense
 java.util.Map<java.lang.String,java.lang.Double> prepareContextVector(Context preprocessedContext)
          Creates vector of context
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchingStrategy

public MatchingStrategy(java.util.Map<java.lang.String,Gloss> preprocessedGlosses,
                        java.lang.String params)
                 throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

prepareContextVector

public java.util.Map<java.lang.String,java.lang.Double> prepareContextVector(Context preprocessedContext)
Creates vector of context

Parameters:
preprocessedContext - context to create vector from
Returns:
vector: word -> value

computeSimilarity

public double computeSimilarity(java.util.Map<java.lang.String,java.lang.Double> contextVector,
                                java.lang.String senseId)
Computes the similarity between context vector and chosen sense

Parameters:
contextVector - vector
senseId - id of chosen sense
Returns:
similarity value