opennlp.tools.coref.sim
Class Context
java.lang.Object
opennlp.tools.coref.mention.Mention
opennlp.tools.coref.sim.Context
- All Implemented Interfaces:
- java.lang.Comparable<Mention>
- Direct Known Subclasses:
- MentionContext
public class Context
- extends Mention
Specifies the context of a mention for computing gender, number, and semantic compatibility.
Constructor Summary |
Context(Mention mention,
HeadFinder headFinder)
|
Context(java.lang.Object[] tokens,
java.lang.String headToken,
java.lang.String headTag,
java.lang.String neType)
|
Context(Span span,
Span headSpan,
int entityId,
Parse parse,
java.lang.String extentType,
java.lang.String nameType,
HeadFinder headFinder)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Context
public Context(Span span,
Span headSpan,
int entityId,
Parse parse,
java.lang.String extentType,
java.lang.String nameType,
HeadFinder headFinder)
Context
public Context(java.lang.Object[] tokens,
java.lang.String headToken,
java.lang.String headTag,
java.lang.String neType)
Context
public Context(Mention mention,
HeadFinder headFinder)
constructContexts
public static Context[] constructContexts(Mention[] mentions,
HeadFinder headFinder)
toString
public java.lang.String toString()
- Overrides:
toString
in class Mention
getTokens
public java.lang.Object[] getTokens()
getHeadTokenText
public java.lang.String getHeadTokenText()
getHeadTokenTag
public java.lang.String getHeadTokenTag()
getSynsets
public java.util.Set<java.lang.String> getSynsets()
parseContext
public static Context parseContext(java.lang.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 © 2011 The Apache Software Foundation. All Rights Reserved.