opennlp.tools.coref
Class DiscourseElement

java.lang.Object
  extended by opennlp.tools.coref.DiscourseElement
Direct Known Subclasses:
DiscourseEntity

public abstract class DiscourseElement
extends Object

Represents an item in which can be put into the discourse model. Object which are to be placed in the discourse model should extend this class.

See Also:
DiscourseModel

Constructor Summary
DiscourseElement(MentionContext mention)
          Creates a new discourse element which contains the specified mention.
 
Method Summary
 void addMention(MentionContext mention)
          Adds the specified mention to this discourse element.
 int getId()
          Returns the id associated with this element.
 MentionContext getLastExtent()
          Returns the last mention for this element.
 Iterator<MentionContext> getMentions()
          Returns an iterator over the mentions which iterates through them based on their occurrence in the document.
 int getNumMentions()
          Returns the number of mentions in this element.
 Iterator<MentionContext> getRecentMentions()
          Returns an iterator over the mentions which iterates through them based on which were most recently mentioned.
 void setId(int id)
          Associates an id with this element.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscourseElement

public DiscourseElement(MentionContext mention)
Creates a new discourse element which contains the specified mention.

Parameters:
mention - The mention which begins this discourse element.
Method Detail

getRecentMentions

public Iterator<MentionContext> getRecentMentions()
Returns an iterator over the mentions which iterates through them based on which were most recently mentioned.

Returns:
the Iterator.

getMentions

public Iterator<MentionContext> getMentions()
Returns an iterator over the mentions which iterates through them based on their occurrence in the document.

Returns:
the Iterator

getNumMentions

public int getNumMentions()
Returns the number of mentions in this element.

Returns:
number of mentions

addMention

public void addMention(MentionContext mention)
Adds the specified mention to this discourse element.

Parameters:
mention - The mention to be added.

getLastExtent

public MentionContext getLastExtent()
Returns the last mention for this element. For appositives this will be the first part of the appositive.

Returns:
the last mention for this element.

setId

public void setId(int id)
Associates an id with this element.

Parameters:
id - The id.

getId

public int getId()
Returns the id associated with this element.

Returns:
the id associated with this element.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010. All Rights Reserved.