opennlp.tools.coref.mention
Class DefaultParse

java.lang.Object
  extended by opennlp.tools.coref.mention.AbstractParse
      extended by opennlp.tools.coref.mention.DefaultParse
All Implemented Interfaces:
Comparable<Parse>, Parse

public class DefaultParse
extends AbstractParse

This class is a wrapper for Parse mapping it to the API specified in Parse. This allows coreference to be done on the output of the parser.


Field Summary
static String[] NAME_TYPES
           
 
Constructor Summary
DefaultParse(Parse parse, int sentenceNumber)
          Initializes the current instance.
 
Method Summary
 int compareTo(Parse p)
           
 boolean equals(Object o)
           
 List<Parse> getChildren()
          Returns a list of the children to this object.
 int getEntityId()
          Returns an entity id associated with this parse and coreferent parses.
 String getEntityType()
          Returns the named-entity type of this node.
 List<Parse> getNamedEntities()
          Returns a list of all the named entities contained by this parse.
 Parse getNextToken()
          Returns the next token which is not a child of this parse.
 Parse getParent()
          Returns the parent parse of this parse node.
 Parse getParse()
          Retrieves the Parse.
 Parse getPreviousToken()
          Returns the first token which is not a child of this parse.
 int getSentenceNumber()
          Returns the index of the sentence which contains this parse.
 Span getSpan()
          Returns the character offsets of this parse node.
 List<Parse> getSyntacticChildren()
          Returns a list of the children to this object which are constituents or tokens.
 String getSyntacticType()
          Returns the syntactic type of this node.
 List<Parse> getTokens()
          Returns a list of the tokens contained by this object.
 int hashCode()
           
 boolean isNamedEntity()
          Specifies whether this parse is a named-entity.
 boolean isNounPhrase()
          Specifies whether this parse is a noun phrase.
 boolean isParentNAC()
          Determines whether this has an ancestor of type NAC.
 boolean isSentence()
          Specifies whether this parse is a sentence.
 boolean isToken()
          Specifies whether this parse is a token.
 String toString()
           
 
Methods inherited from class opennlp.tools.coref.mention.AbstractParse
getNounPhrases, isCoordinatedNounPhrase
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME_TYPES

public static String[] NAME_TYPES
Constructor Detail

DefaultParse

public DefaultParse(Parse parse,
                    int sentenceNumber)
Initializes the current instance.

Parameters:
parse -
sentenceNumber -
Method Detail

getSentenceNumber

public int getSentenceNumber()
Description copied from interface: Parse
Returns the index of the sentence which contains this parse.

Returns:
The index of the sentence which contains this parse.

getNamedEntities

public List<Parse> getNamedEntities()
Description copied from interface: Parse
Returns a list of all the named entities contained by this parse. The named entities in this list should also implement the Parse interface.

Returns:
a list of all the named entities contained by this parse.

getChildren

public List<Parse> getChildren()
Description copied from interface: Parse
Returns a list of the children to this object. The children should also implement the Parse interface.

Returns:
a list of the children to this object.

getSyntacticChildren

public List<Parse> getSyntacticChildren()
Description copied from interface: Parse
Returns a list of the children to this object which are constituents or tokens. The children should also implement the Parse interface. This allows implementations which contain addition nodes for things such as semantic categories to hide those nodes from the components which only care about syntactic nodes.

Returns:
a list of the children to this object which are constituents or tokens.

getTokens

public List<Parse> getTokens()
Description copied from interface: Parse
Returns a list of the tokens contained by this object. The tokens in this list should also implement the Parse interface.

Returns:
the tokens

getSyntacticType

public String getSyntacticType()
Description copied from interface: Parse
Returns the syntactic type of this node. Typically this is the part-of-speech or constituent labeling.

Returns:
the syntactic type.

getEntityType

public String getEntityType()
Description copied from interface: Parse
Returns the named-entity type of this node.

Returns:
the named-entity type.

isParentNAC

public boolean isParentNAC()
Description copied from interface: Parse
Determines whether this has an ancestor of type NAC.

Returns:
true is this has an ancestor of type NAC, false otherwise.

getParent

public Parse getParent()
Description copied from interface: Parse
Returns the parent parse of this parse node.

Returns:
the parent parse of this parse node.

isNamedEntity

public boolean isNamedEntity()
Description copied from interface: Parse
Specifies whether this parse is a named-entity.

Returns:
True if this parse is a named-entity; false otherwise.

isNounPhrase

public boolean isNounPhrase()
Description copied from interface: Parse
Specifies whether this parse is a noun phrase.

Returns:
True if this parse is a noun phrase; false otherwise.

isSentence

public boolean isSentence()
Description copied from interface: Parse
Specifies whether this parse is a sentence.

Returns:
True if this parse is a sentence; false otherwise.

isToken

public boolean isToken()
Description copied from interface: Parse
Specifies whether this parse is a token.

Returns:
True if this parse is a token; false otherwise.

getEntityId

public int getEntityId()
Description copied from interface: Parse
Returns an entity id associated with this parse and coreferent parses. This is only used for training on already annotated coreference annotation.

Returns:
an entity id associated with this parse and coreferent parses.

getSpan

public Span getSpan()
Description copied from interface: Parse
Returns the character offsets of this parse node.

Returns:
The span representing the character offsets of this parse node.

compareTo

public int compareTo(Parse p)

toString

public String toString()
Specified by:
toString in interface Parse
Overrides:
toString in class Object

getPreviousToken

public Parse getPreviousToken()
Description copied from interface: Parse
Returns the first token which is not a child of this parse. If the first token of a sentence is a child of this parse then null is returned.

Returns:
the first token which is not a child of this parse or null if no such token exists.

getNextToken

public Parse getNextToken()
Description copied from interface: Parse
Returns the next token which is not a child of this parse. If the last token of a sentence is a child of this parse then null is returned.

Returns:
the next token which is not a child of this parse or null if no such token exists.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getParse

public Parse getParse()
Retrieves the Parse.

Returns:
the Parse


Copyright © 2010. All Rights Reserved.