com.aliasi.coref
Class WithinDocCoref

java.lang.Object
  extended by com.aliasi.coref.WithinDocCoref

public final class WithinDocCoref
extends Object

A WithinDocCoref object handles resolution of coreference relations between mentions of entities.

Since:
LingPipe1.0
Version:
3.9.1
Author:
Bob Carpenter

Field Summary
static Comparator<MentionChain> SENTENCE_FINAL_COMPARATOR
          A comparator for comparing two mentions chains.
 
Constructor Summary
WithinDocCoref(MentionFactory mentionFactory)
          Construct an instance of within-document coreference with the specified mention factory.
 
Method Summary
 MentionChain[] mentionChains()
          Returns the set of mention chains, sorted in order of identifier from first appearance to last.
 int resolveMention(Mention mention, int offset)
          Resolves a specified mention at a specified offset, returning the integer identifier of the mention, or -1 if the mention could not be resolved, which should only occur for pronominal mentions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SENTENCE_FINAL_COMPARATOR

public static final Comparator<MentionChain> SENTENCE_FINAL_COMPARATOR
A comparator for comparing two mentions chains. The greater one is the one with the largest sentence offset. May return 0 for entities that are not equal according to but this is OK because they're just being sorted. Also * not coordinated with the mention chain's equality or hash code. * The sort is also not stable; changing mention chains by adding mentions may change the results in subsequent runs.

Constructor Detail

WithinDocCoref

public WithinDocCoref(MentionFactory mentionFactory)
Construct an instance of within-document coreference with the specified mention factory.

Parameters:
mentionFactory - Factory for creating mentions and chains.
Method Detail

mentionChains

public MentionChain[] mentionChains()
Returns the set of mention chains, sorted in order of identifier from first appearance to last.

Returns:
Array of mention chains resolved for this document.

resolveMention

public int resolveMention(Mention mention,
                          int offset)
Resolves a specified mention at a specified offset, returning the integer identifier of the mention, or -1 if the mention could not be resolved, which should only occur for pronominal mentions.

Parameters:
mention - Mention to resolve.
offset - Sentence offset of the specified mention.
Returns:
Integer identifier for the mention, or -1 if it could not be resolved.