edu.mit.jwi.item
Class IndexWord

java.lang.Object
  extended by edu.mit.jwi.item.IndexWord
All Implemented Interfaces:
IHasPOS, IIndexWord, IItem<IIndexWordID>, java.io.Serializable

public class IndexWord
extends java.lang.Object
implements IIndexWord

Default implementation of IIndexWord.

Since:
JWI 1.0
Version:
2.4.0
Author:
Mark A. Finlayson
See Also:
Serialized Form

Constructor Summary
IndexWord(IIndexWordID id, int tagSenseCnt, IPointer[] ptrs, IWordID... words)
          Constructs a new index word.
IndexWord(IIndexWordID id, int tagSenseCnt, IWordID... words)
          Constructs a new index word.
IndexWord(java.lang.String lemma, POS pos, int tagSenseCnt, IPointer[] ptrs, IWordID... words)
          Constructs a new index word.
IndexWord(java.lang.String lemma, POS pos, int tagSenseCnt, IWordID... words)
          Constructs a new index word.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 IIndexWordID getID()
          Returns the ID object for this item.
 java.lang.String getLemma()
           
 java.util.Set<IPointer> getPointers()
          Returns an immutable set containing all the different types of pointers that this index word has in all synsets containing this word.
 POS getPOS()
          Returns the associated part of speech for this object.
 int getTagSenseCount()
          Returns the number of senses of lemma that are ranked according to their frequency of occurrence in semantic concordance texts.
 java.util.List<IWordID> getWordIDs()
          Returns an immutable list of word id objects, that point to the words for this root form and part of speech combination.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndexWord

public IndexWord(java.lang.String lemma,
                 POS pos,
                 int tagSenseCnt,
                 IWordID... words)
Constructs a new index word.

Parameters:
lemma - the lemma of this index word
pos - the part of speech of this index word
tagSenseCnt - the tag sense count
words - the words for this index word
Throws:
java.lang.NullPointerException - if lemma, pos, or word array is null, or the word array contains null
java.lang.IllegalArgumentException - if the tag sense count is negative, or the word array is empty
Since:
JWI 1.0

IndexWord

public IndexWord(java.lang.String lemma,
                 POS pos,
                 int tagSenseCnt,
                 IPointer[] ptrs,
                 IWordID... words)
Constructs a new index word.

Parameters:
lemma - the lemma of this index word
pos - the part of speech of this index word
tagSenseCnt - the tag sense count
ptrs - an array of pointers that the synsets with lemma have; may be null
words - the words for this index word
Throws:
java.lang.NullPointerException - if lemma, pos, or word array is null, or the word array or pointer array contains null
java.lang.IllegalArgumentException - if the tag sense count is negative, or the word array is empty
Since:
JWI 2.3.0

IndexWord

public IndexWord(IIndexWordID id,
                 int tagSenseCnt,
                 IWordID... words)
Constructs a new index word.

Parameters:
id - the index word id for this index word
tagSenseCnt - the tag sense count
words - the words for this index word
Throws:
java.lang.NullPointerException - if lemma, pos, or word array is null, or the word array contains null
java.lang.IllegalArgumentException - if the tag sense count is negative, or the word array is empty
Since:
JWI 1.0

IndexWord

public IndexWord(IIndexWordID id,
                 int tagSenseCnt,
                 IPointer[] ptrs,
                 IWordID... words)
Constructs a new index word.

Parameters:
id - the index word id for this index word
tagSenseCnt - the tag sense count
ptrs - an array of pointers for all the synsets of this lemma; may be null; must not contain null
words - the words for this index word
Throws:
java.lang.NullPointerException - if lemma, pos, or word array is null, or the word array or pointer array contains null
java.lang.IllegalArgumentException - if the tag sense count is negative, or the word array is empty
Since:
JWI 2.3.0
Method Detail

getLemma

public java.lang.String getLemma()
Specified by:
getLemma in interface IIndexWord
Returns:
the lemma (word root) associated with this index word.

getPointers

public java.util.Set<IPointer> getPointers()
Description copied from interface: IIndexWord
Returns an immutable set containing all the different types of pointers that this index word has in all synsets containing this word. If all senses of the word have no pointers, this method returns an empty set.

Specified by:
getPointers in interface IIndexWord
Returns:
an immutable set of all pointers across all synsets for this word

getWordIDs

public java.util.List<IWordID> getWordIDs()
Description copied from interface: IIndexWord
Returns an immutable list of word id objects, that point to the words for this root form and part of speech combination. The list will neither be null or empty, or contain null.

Specified by:
getWordIDs in interface IIndexWord
Returns:
an immutable list of word id objects, that point to the words for this root form and part of speech combination.

getTagSenseCount

public int getTagSenseCount()
Description copied from interface: IIndexWord
Returns the number of senses of lemma that are ranked according to their frequency of occurrence in semantic concordance texts. This will be a non-negative number.

Specified by:
getTagSenseCount in interface IIndexWord
Returns:
the number of senses of lemma that are ranked according to their frequency of occurrence in semantic concordance texts.

getID

public IIndexWordID getID()
Description copied from interface: IItem
Returns the ID object for this item. Will not return null.

Specified by:
getID in interface IItem<IIndexWordID>
Returns:
the non-null ID for this item

getPOS

public POS getPOS()
Description copied from interface: IHasPOS
Returns the associated part of speech for this object. If this object is not associated with any particular part of speech, this method may return null.

Specified by:
getPOS in interface IHasPOS
Returns:
The associated part of speech, or null if none.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2007-2013 Massachusetts Institute of Technology. All Rights Reserved.