cic.wsd.disambiguation
Class WSDAlgorithm

java.lang.Object
  extended by cic.wsd.disambiguation.WSDAlgorithm
Direct Known Subclasses:
ConceptualDensity, GraphInDegree, MFS, RandomSense, SimplifiedLesk

public abstract class WSDAlgorithm
extends java.lang.Object

Generic template for a bag-of-words disambiguation algorithm.

Author:
Francisco Viveros-Jiménez

Field Summary
(package private)  java.util.ArrayList<cic.wordnet.pairs.KeyString> params
          ArrayList for containing extra parameters and its values.
 
Constructor Summary
WSDAlgorithm()
           
 
Method Summary
abstract  Decision disambiguate(AmbiguousWord target, java.util.ArrayList<AmbiguousWord> window)
          Disambiguates target using the window.
 java.lang.String getParams()
           
 boolean overlap(cic.wordnet.ParsedSynset sense, AmbiguousWord lemma, java.util.ArrayList<java.lang.String> dwords)
          Returns the overlap between a sense and an AmbiguousWord.
 boolean overlap(cic.wordnet.ParsedSynset sense, cic.wordnet.ParsedSynset sense2, java.util.ArrayList<java.lang.String> dwords)
          Returns the overlap between two senses.
 boolean overlap(cic.wordnet.ParsedSynset sense, java.lang.String lemma)
          Tells if the overlap between a sense and a lemma exists.
 void setParams(java.lang.String string)
          Method for setting extra parameters.
 java.util.ArrayList<Decision> solve(Input document, java.util.ArrayList<Condition> conditions, int windowSize, WSDAlgorithm backoff, WSDAlgorithm tie)
          Tells the disambiguation algorithm to solve an input document.
abstract  java.lang.String toString()
          Return the name of the algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

params

java.util.ArrayList<cic.wordnet.pairs.KeyString> params
ArrayList for containing extra parameters and its values.

Constructor Detail

WSDAlgorithm

public WSDAlgorithm()
Method Detail

solve

public java.util.ArrayList<Decision> solve(Input document,
                                           java.util.ArrayList<Condition> conditions,
                                           int windowSize,
                                           WSDAlgorithm backoff,
                                           WSDAlgorithm tie)
Tells the disambiguation algorithm to solve an input document.

Parameters:
document - The disambiguated document.
conditions - Conditions for window selection.
windowSize - Maximum number of words in the window.
backoff - Back-off strategy.
tie - Algorithm to be used for solving ties.
Returns:
Decisions made by the algorithm.

disambiguate

public abstract Decision disambiguate(AmbiguousWord target,
                                      java.util.ArrayList<AmbiguousWord> window)
Disambiguates target using the window.

Parameters:
target - The AmbiguousWord to be disambiguated.
window - The context window that helps disambiguation process.
Returns:
The Decision made by the algorithm.

toString

public abstract java.lang.String toString()
Return the name of the algorithm.

Overrides:
toString in class java.lang.Object

overlap

public boolean overlap(cic.wordnet.ParsedSynset sense,
                       java.lang.String lemma)
Tells if the overlap between a sense and a lemma exists.

Parameters:
sense - Target sense.
lemma - Target lemma.
Returns:
true if there is an overlap.

overlap

public boolean overlap(cic.wordnet.ParsedSynset sense,
                       cic.wordnet.ParsedSynset sense2,
                       java.util.ArrayList<java.lang.String> dwords)
Returns the overlap between two senses.

Parameters:
sense - Sense 1.
sense2 - Sense 2.
dwords - ArrayList for storing the overlapping words.
Returns:
true if there is an overlap.

overlap

public boolean overlap(cic.wordnet.ParsedSynset sense,
                       AmbiguousWord lemma,
                       java.util.ArrayList<java.lang.String> dwords)
Returns the overlap between a sense and an AmbiguousWord.

Parameters:
sense - Target sense.
lemma - Target AmbiguousWord.
dwords - ArrayList for storing the overlapping words.
Returns:
true if there is an overlap.

setParams

public void setParams(java.lang.String string)
Method for setting extra parameters.

Parameters:
string - String containing the values and names of the extra parameters.

getParams

public java.lang.String getParams()
Returns:
An String like "((param1:value1) , ... , (paramN:valueN))".