net.sf.extjwnl.data
Class IndexWordSet

java.lang.Object
  extended by net.sf.extjwnl.data.IndexWordSet

public class IndexWordSet
extends Object

A class to simplify the access to a set of IndexWords, each containing one part of speech of the same word. IndexWordSets are usually created by a call to Dictionary.lookupAllIndexWords.

Author:
John Didion , Aliaksandr Autayeu

Constructor Summary
IndexWordSet(String lemma)
           
 
Method Summary
 void add(IndexWord word)
          Adds an IndexWord to this set.
 boolean equals(Object object)
          It is assumed that IndexWordSets will only be created by calling Dictionary.lookupAllIndexWords, so all IndexWordSets with the same lemma should be equal.
 IndexWord getIndexWord(POS p)
          Returns the IndexWord associated with POS p.
 IndexWord[] getIndexWordArray()
          Returns an array of the IndexWords in this set.
 Collection getIndexWordCollection()
          Returns a collection of the IndexWords in this set.
 String getLemma()
           
 int getSenseCount(POS pos)
          Finds out how many senses the word with part-of-speech pos has.
 Set getValidPOSSet()
          Returns a set of all the parts-of-speech for which there is an IndexWord in this set.
 boolean isValidPOS(POS pos)
          Return true if there is a word with part-of-speech pos in this set.
 void remove(POS p)
          Removes the IndexWords associated with POS p from this set.
 int size()
          Returns the number of IndexWords in this set.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexWordSet

public IndexWordSet(String lemma)
Method Detail

add

public void add(IndexWord word)
Adds an IndexWord to this set.

Parameters:
word - word to add

remove

public void remove(POS p)
Removes the IndexWords associated with POS p from this set.

Parameters:
p - POS

size

public int size()
Returns the number of IndexWords in this set.

Returns:
the number of IndexWords in this set

getIndexWord

public IndexWord getIndexWord(POS p)
Returns the IndexWord associated with POS p.

Parameters:
p - POS
Returns:
the IndexWord associated with POS p.

getIndexWordArray

public IndexWord[] getIndexWordArray()
Returns an array of the IndexWords in this set.

Returns:
an array of the IndexWords in this set

getIndexWordCollection

public Collection getIndexWordCollection()
Returns a collection of the IndexWords in this set.

Returns:
a collection of the IndexWords in this set

getValidPOSSet

public Set getValidPOSSet()
Returns a set of all the parts-of-speech for which there is an IndexWord in this set.

Returns:
a set of all the parts-of-speech for which there is an IndexWord in this set

isValidPOS

public boolean isValidPOS(POS pos)
Return true if there is a word with part-of-speech pos in this set.

Parameters:
pos - POS
Returns:
true if there is a word with part-of-speech pos in this set.

getSenseCount

public int getSenseCount(POS pos)
Finds out how many senses the word with part-of-speech pos has.

Parameters:
pos - POS
Returns:
number of senses the word with part-of-speech pos has

toString

public String toString()
Overrides:
toString in class Object

getLemma

public String getLemma()

equals

public boolean equals(Object object)
It is assumed that IndexWordSets will only be created by calling Dictionary.lookupAllIndexWords, so all IndexWordSets with the same lemma should be equal.

Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.