gov.llnl.ontology.wordnet.wsd
Class LeskWordSenseDisambiguation

java.lang.Object
  extended by gov.llnl.ontology.wordnet.wsd.SlidingWindowDisambiguation
      extended by gov.llnl.ontology.wordnet.wsd.LeskWordSenseDisambiguation
All Implemented Interfaces:
WordSenseDisambiguation
Direct Known Subclasses:
ExtendedLeskWordSenseDisambiguation

public class LeskWordSenseDisambiguation
extends SlidingWindowDisambiguation

A WordSenseDisambiguation implementation using the LeskSimilarity measure.

This class is thread safe.

Author:
Keith Stevens

Field Summary
protected  OntologyReader reader
          The OntologyReader used to extract Synsets.
protected  SynsetSimilarity sim
          The SynsetSimilarity function used to compare two Synsets.
 
Constructor Summary
LeskWordSenseDisambiguation()
           
 
Method Summary
protected  void processContext(edu.stanford.nlp.pipeline.Annotation focus, edu.stanford.nlp.pipeline.Annotation result, Queue<edu.stanford.nlp.pipeline.Annotation> prevWords, Queue<edu.stanford.nlp.pipeline.Annotation> nextWords)
          Processes the local context surrounded focus.
 void setup(OntologyReader reader)
          Initializes the WordSenseDisambiguation algorithm with the given OntologyReader.
 String toString()
          Returns "ld", the acronyms for this WordSenseDisambiguation algorithm.
 
Methods inherited from class gov.llnl.ontology.wordnet.wsd.SlidingWindowDisambiguation
disambiguate, disambiguate, getSynsets
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

reader

protected OntologyReader reader
The OntologyReader used to extract Synsets.


sim

protected SynsetSimilarity sim
The SynsetSimilarity function used to compare two Synsets.

Constructor Detail

LeskWordSenseDisambiguation

public LeskWordSenseDisambiguation()
Method Detail

setup

public void setup(OntologyReader reader)
Initializes the WordSenseDisambiguation algorithm with the given OntologyReader. Any other configuration values should be set via the global system properties object.


processContext

protected void processContext(edu.stanford.nlp.pipeline.Annotation focus,
                              edu.stanford.nlp.pipeline.Annotation result,
                              Queue<edu.stanford.nlp.pipeline.Annotation> prevWords,
                              Queue<edu.stanford.nlp.pipeline.Annotation> nextWords)
Processes the local context surrounded focus. This should update focus with any word sense disambiguation Annotations discovered.

Specified by:
processContext in class SlidingWindowDisambiguation
Parameters:
focus - The Annotation to disambiguate.
prevWords - The N Annotation words before focus.
nextWords - The N Annotation words after focus.

toString

public String toString()
Returns "ld", the acronyms for this WordSenseDisambiguation algorithm.

Overrides:
toString in class Object


Copyright © 2010-2011. All Rights Reserved.