opennlp.tools.coref
Class DiscourseElement

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

public abstract class DiscourseElement
extends java.lang.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.
 java.util.Iterator getMentions()
          Returns an iterator over the mentions which iteratates through them based on their occurance in the document.
 int getNumMentions()
          Returns the number of mentions in this element.
 java.util.Iterator getRecentMentions()
          Returns an iterator over the mentions which iteratates through them based on which were most recently mentioned.
 void setId(int id)
          Associates an id with this element.
 java.lang.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 java.util.Iterator getRecentMentions()
Returns an iterator over the mentions which iteratates through them based on which were most recently mentioned.

Returns:
an iterator over the mentions which iteratates through them based on which were most recently mentioned.

getMentions

public java.util.Iterator getMentions()
Returns an iterator over the mentions which iteratates through them based on their occurance in the document.

Returns:
an iterator over the mentions which iteratates through them based on their occurance in the document.

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 java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2008 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.