com.sun.labs.minion.lexmorph.disambiguation
Class Sense

java.lang.Object
  extended by com.sun.labs.minion.lexmorph.disambiguation.Sense
All Implemented Interfaces:
java.io.Serializable

public class Sense
extends java.lang.Object
implements java.io.Serializable

A class representing a particular sense of a word. This can be used for supervised sense diambiguation.

See Also:
Serialized Form

Constructor Summary
Sense()
           
Sense(java.lang.String term, java.util.Set<java.lang.String> vocab, double missingP, java.lang.String name, int totalCount, java.util.List<Context> contexts)
          Creates a sense for a term.
 
Method Summary
 java.lang.String getName()
           
 java.lang.String getTerm()
           
 double score(java.util.List<java.lang.String> context)
          Computes the probability of a given context containing the that context being this sense.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sense

public Sense()

Sense

public Sense(java.lang.String term,
             java.util.Set<java.lang.String> vocab,
             double missingP,
             java.lang.String name,
             int totalCount,
             java.util.List<Context> contexts)
      throws SearchEngineException
Creates a sense for a term.

Parameters:
term - the term of which this is a sense (e.g., bank)
vocab - the complete set of terms across all the senses for a term, which we can use to figure out probabilities for words not in our contexts.
missingP - the probability to use for a term that's not in the contexts.
name - the name of the sense (e.g., river
totalCount - the total count of occurences of this word over all senses.
contexts - the contexts in which this sense occurs
Throws:
SearchEngineException - if there are any errors processing the sense.
Method Detail

score

public double score(java.util.List<java.lang.String> context)
Computes the probability of a given context containing the that context being this sense.

Parameters:
context - the terms in the context we're evaluating
Returns:
the probability of the word in this context having this sense

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTerm

public java.lang.String getTerm()

getName

public java.lang.String getName()