edu.illinois.cs.cogcomp.lbj.coref.features
Class DistanceFeatures

java.lang.Object
  extended by edu.illinois.cs.cogcomp.lbj.coref.features.DistanceFeatures

public class DistanceFeatures
extends java.lang.Object

Collection of features related to the relative location of mentions.


Constructor Summary
protected DistanceFeatures()
          Construction of this static feature library should not be necessary.
 
Method Summary
static boolean areAppositives(CExample ex)
          Determines whether two mentions are in an appositive relationship, currently approximated by checking whether only a comma intervenes between their extents.
static boolean areClosestCompatible(CExample ex)
          Determines whether the first mention of ex is the closest preceding mention compatible with the second mention of ex.
static boolean compatible(Doc d, Mention m1, Mention m2)
          Determines whether two mentions are compatible.
static int getNumCompatibleMentsBetween(CExample ex)
          Computes the number of mentions between ex.getM1() and ex.getM2() that are compatible with m2.
static int getNumMentsBetween(CExample ex)
          Computes the distance in mentions of the mentions of ex Runs in time proportional to the number of mentions.
static java.lang.String mentionDistHeads(CExample ex)
          Computes the distance of the mentions of ex, in mention count, as a string, or "BIG" if that number is greater than or equal to 10.
static boolean soonAppositive(CExample ex)
          Determine whether the mentions are in an appositive relationship, as defined by Soon et al., 2001.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistanceFeatures

protected DistanceFeatures()
Construction of this static feature library should not be necessary.

Method Detail

mentionDistHeads

public static java.lang.String mentionDistHeads(CExample ex)
Computes the distance of the mentions of ex, in mention count, as a string, or "BIG" if that number is greater than or equal to 10. The result is more precisely the absolute value of the difference between the indexes of the mentions in the List returned by the document's getMentions() method. This method runs in time proportional to the time of List.indexOf(java.lang.Object) on the List returned by Doc.getMentions().

Parameters:
ex - The example whose mentions' distance is being computed.
Returns:
A string containing a positive number less than 10, or "BIG".

getNumMentsBetween

public static int getNumMentsBetween(CExample ex)
Computes the distance in mentions of the mentions of ex Runs in time proportional to the number of mentions. The result is more precisely the absolute value of the difference between the indexes of the mentions in the List returned by the document's Doc.getMentions() method.

Parameters:
ex - The example whose mentions' distance is being computed.
Returns:
The distance between the mentions.

getNumCompatibleMentsBetween

public static int getNumCompatibleMentsBetween(CExample ex)
Computes the number of mentions between ex.getM1() and ex.getM2() that are compatible with m2. The definition of compatible will vary but includes gender and number compatibility and is defined by the compatible(edu.illinois.cs.cogcomp.lbj.coref.ir.docs.Doc, edu.illinois.cs.cogcomp.lbj.coref.ir.Mention, edu.illinois.cs.cogcomp.lbj.coref.ir.Mention) method.

Parameters:
ex - The example.
Returns:
The number of compatible mentions between the example mentions.

areClosestCompatible

public static boolean areClosestCompatible(CExample ex)
Determines whether the first mention of ex is the closest preceding mention compatible with the second mention of ex.

Parameters:
ex - The example containing the mentions.

compatible

public static boolean compatible(Doc d,
                                 Mention m1,
                                 Mention m2)
Determines whether two mentions are compatible. Two mentions are compatible only if they are quite likely to be able to be in the same class. This means that all checked attributes must be true and none may be unknown or false.

Parameters:
d - The document containing both mentions.
m1 - One mention.
m2 - A second mention.

areAppositives

public static boolean areAppositives(CExample ex)
Determines whether two mentions are in an appositive relationship, currently approximated by checking whether only a comma intervenes between their extents.

Parameters:
ex - The example containing the mentions in question.

soonAppositive

public static boolean soonAppositive(CExample ex)
Determine whether the mentions are in an appositive relationship, as defined by Soon et al., 2001. Mentions are in an appositive relationship if at least one is not a proper name, and either their heads or their extents are separated only by a comma.

Parameters:
ex - The example containing the mentions to examine.
Returns:
Whether the mentions are in an appositive relationship.