Package net.didion.jwnl.data
Class IndexWordSet
- java.lang.Object
-
- net.didion.jwnl.data.IndexWordSet
-
public class IndexWordSet extends java.lang.ObjectA class to simplify the access to a set ofIndexWords, each containing one part of speech of the same word. IndexWordSets are usually created by a call toDictionary.lookupAllIndexWords.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String_cachedToStringprivate java.util.Map_indexWordsMap of IndexWords in this set.private java.lang.String_lemma
-
Constructor Summary
Constructors Constructor Description IndexWordSet(java.lang.String lemma)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(IndexWord word)Add an IndexWord to this setbooleanequals(java.lang.Object object)It is assumed that IndexWordSets will only be created by callingDictionary.lookupAllIndexWords, so all IndexWordSets with the same lemma should be equal.IndexWordgetIndexWord(POS p)Get the IndexWord associated withp.IndexWord[]getIndexWordArray()Get an array of the IndexWords in this set.java.util.CollectiongetIndexWordCollection()Get a collection of the IndexWords in this set.java.lang.StringgetLemma()intgetSenseCount(POS pos)Find out how many senses the word with part-of-speechposhas.java.util.SetgetValidPOSSet()Get a set of all the parts-of-speech for which there is an IndexWord in this set.booleanisValidPOS(POS pos)Return true if there is a word with part-of-speechposin this set.voidremove(POS p)Remove the IndexWord associated withpfrom this set.intsize()Get the number of IndexWords in this setjava.lang.StringtoString()
-
-
-
Method Detail
-
add
public void add(IndexWord word)
Add an IndexWord to this set
-
remove
public void remove(POS p)
Remove the IndexWord associated withpfrom this set.
-
size
public int size()
Get the number of IndexWords in this set
-
getIndexWordArray
public IndexWord[] getIndexWordArray()
Get an array of the IndexWords in this set.
-
getIndexWordCollection
public java.util.Collection getIndexWordCollection()
Get a collection of the IndexWords in this set.
-
getValidPOSSet
public java.util.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-speechposin this set.
-
getSenseCount
public int getSenseCount(POS pos)
Find out how many senses the word with part-of-speechposhas.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getLemma
public java.lang.String getLemma()
-
equals
public boolean equals(java.lang.Object object)
It is assumed that IndexWordSets will only be created by callingDictionary.lookupAllIndexWords, so all IndexWordSets with the same lemma should be equal.- Overrides:
equalsin classjava.lang.Object
-
-