opennlp.tools.coref.sim
Class Context

java.lang.Object
  extended by opennlp.tools.coref.mention.Mention
      extended by opennlp.tools.coref.sim.Context
All Implemented Interfaces:
Comparable<Mention>
Direct Known Subclasses:
MentionContext

public class Context
extends Mention

Specifies the context of a mention for computing gender, number, and semantic compatibility.


Field Summary
protected  int headTokenIndex
          The token index in of the head word of this mention.
protected  String headTokenTag
           
protected  String headTokenText
           
protected  Set<String> synsets
           
protected  Object[] tokens
           
 
Fields inherited from class opennlp.tools.coref.mention.Mention
nameType, parse, type
 
Constructor Summary
Context(Mention mention, HeadFinder headFinder)
           
Context(Object[] tokens, String headToken, String headTag, String neType)
           
Context(Span span, Span headSpan, int entityId, Parse parse, String extentType, String nameType, HeadFinder headFinder)
           
 
Method Summary
static Context[] constructContexts(Mention[] mentions, HeadFinder headFinder)
           
 int getHeadTokenIndex()
          Returns the token index into the mention for the head word.
 String getHeadTokenTag()
           
 String getHeadTokenText()
           
 Set<String> getSynsets()
           
 Object[] getTokens()
           
static Context parseContext(String word)
           
 String toString()
           
 
Methods inherited from class opennlp.tools.coref.mention.Mention
compareTo, getHeadSpan, getId, getNameType, getParse, getSpan, setId, setNameType, setParse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

headTokenText

protected String headTokenText

headTokenTag

protected String headTokenTag

synsets

protected Set<String> synsets

tokens

protected Object[] tokens

headTokenIndex

protected int headTokenIndex
The token index in of the head word of this mention.

Constructor Detail

Context

public Context(Span span,
               Span headSpan,
               int entityId,
               Parse parse,
               String extentType,
               String nameType,
               HeadFinder headFinder)

Context

public Context(Object[] tokens,
               String headToken,
               String headTag,
               String neType)

Context

public Context(Mention mention,
               HeadFinder headFinder)
Method Detail

constructContexts

public static Context[] constructContexts(Mention[] mentions,
                                          HeadFinder headFinder)

toString

public String toString()
Overrides:
toString in class Mention

getTokens

public Object[] getTokens()

getHeadTokenText

public String getHeadTokenText()

getHeadTokenTag

public String getHeadTokenTag()

getSynsets

public Set<String> getSynsets()

parseContext

public static Context parseContext(String word)

getHeadTokenIndex

public int getHeadTokenIndex()
Returns the token index into the mention for the head word.

Returns:
the token index into the mention for the head word.


Copyright © 2010. All Rights Reserved.