Class IndexWordSet

java.lang.Object
net.didion.jwnl.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.
  • Field Details

    • _indexWords

      private Map _indexWords
      Map of IndexWords in this set.
    • _lemma

      private String _lemma
    • _cachedToString

      private transient String _cachedToString
  • Constructor Details

    • IndexWordSet

      public IndexWordSet(String lemma)
  • Method Details

    • add

      public void add(IndexWord word)
      Add an IndexWord to this set
    • remove

      public void remove(POS p)
      Remove the IndexWord associated with p from this set.
    • size

      public int size()
      Get the number of IndexWords in this set
    • getIndexWord

      public IndexWord getIndexWord(POS p)
      Get the IndexWord associated with p.
    • getIndexWordArray

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

      public Collection getIndexWordCollection()
      Get a collection of the IndexWords in this set.
    • getValidPOSSet

      public Set getValidPOSSet()
      Get 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.
    • getSenseCount

      public int getSenseCount(POS pos)
      Find out how many 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