opennlp.tools.coref.mention
Class JWNLDictionary

java.lang.Object
  extended by opennlp.tools.coref.mention.JWNLDictionary
All Implemented Interfaces:
Dictionary

public class JWNLDictionary
extends java.lang.Object
implements Dictionary

An implementation of the Dictionary interface using the JWNL library.


Constructor Summary
JWNLDictionary(java.lang.String searchDirectory)
           
 
Method Summary
 java.lang.String[] getLemmas(java.lang.String word, java.lang.String tag)
          Returns the lemmas of the specified word with the specified part-of-speech.
 int getNumSenses(java.lang.String lemma, java.lang.String pos)
          Returns the number of senses in the dictionary for the specified lemma.
 java.lang.String[] getParentSenseKeys(java.lang.String lemma, java.lang.String pos, int sense)
          Returns an array of keys for each parent of the specified sense number of the specified lemma with the specified part-of-speech.
 java.lang.String getSenseKey(java.lang.String lemma, java.lang.String pos, int sense)
          Returns a key indicating the specified sense number of the specified lemma with the specified part-of-speech.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWNLDictionary

public JWNLDictionary(java.lang.String searchDirectory)
               throws java.io.IOException,
                      net.didion.jwnl.JWNLException
Throws:
java.io.IOException
net.didion.jwnl.JWNLException
Method Detail

getLemmas

public java.lang.String[] getLemmas(java.lang.String word,
                                    java.lang.String tag)
Description copied from interface: Dictionary
Returns the lemmas of the specified word with the specified part-of-speech.

Specified by:
getLemmas in interface Dictionary
Parameters:
word - The word whose lemmas are desired.
tag - The part-of-speech of the specified word.
Returns:
The lemmas of the specified word given the specified part-of-speech.

getSenseKey

public java.lang.String getSenseKey(java.lang.String lemma,
                                    java.lang.String pos,
                                    int sense)
Description copied from interface: Dictionary
Returns a key indicating the specified sense number of the specified lemma with the specified part-of-speech.

Specified by:
getSenseKey in interface Dictionary
Parameters:
lemma - The lemmas for which the key is desired.
pos - The pos for which the key is desired.
sense - The sense number for which the key is desired.
Returns:
a key indicating the specified sense number of the specified lemma with the specified part-of-speech.

getNumSenses

public int getNumSenses(java.lang.String lemma,
                        java.lang.String pos)
Description copied from interface: Dictionary
Returns the number of senses in the dictionary for the specified lemma.

Specified by:
getNumSenses in interface Dictionary
Parameters:
lemma - A lemmatized form of the word to look up.
pos - The part-of-speech for the lemma.
Returns:
the number of senses in the dictionary for the specified lemma.

getParentSenseKeys

public java.lang.String[] getParentSenseKeys(java.lang.String lemma,
                                             java.lang.String pos,
                                             int sense)
Description copied from interface: Dictionary
Returns an array of keys for each parent of the specified sense number of the specified lemma with the specified part-of-speech.

Specified by:
getParentSenseKeys in interface Dictionary
Parameters:
lemma - A lemmatized form of the word to look up.
pos - The part-of-speech for the lemma.
sense - The sense number for which the parent keys are desired.
Returns:
an array of keys for each parent of the specified sense number of the specified lemma with the specified part-of-speech.

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        net.didion.jwnl.JWNLException
Throws:
java.io.IOException
net.didion.jwnl.JWNLException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.