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

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

public class AlignedTokenFeatures
extends java.lang.Object

Collection of feature generating functions that compare or return aligned tokens.


Constructor Summary
private AlignedTokenFeatures()
          No need to construct collection of features.
 
Method Summary
static boolean aligned(java.lang.String a, java.lang.String b)
          Determines whether two strings should be aligned; strings should be aligned if they share hypernyms, are both countries, both cities, both first names, or both last names.
static java.lang.String[] getWNAlignedPairRelations(CExample ex)
          Extracts the relations between the aligned words returned by getWNAlignedPreModifierPairs()
static java.lang.String[] getWNAlignedPairRelations(java.util.List<Pair<java.lang.String,java.lang.String>> pairs)
          Computes the relations between pairs of words.
static java.util.List<Pair<java.lang.String,java.lang.String>> getWNAlignedPreModifierPairs(CExample ex)
          Aligns each word a in the first mention before its head to each word b in the second mention's extent that is aligned to a according to aligned(java.lang.String, java.lang.String).
static java.util.List<java.lang.String> getWNAlignedPreModifiers(CExample ex)
          Gets the aligned words conjoined as strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlignedTokenFeatures

private AlignedTokenFeatures()
No need to construct collection of features.

Method Detail

getWNAlignedPreModifiers

public static java.util.List<java.lang.String> getWNAlignedPreModifiers(CExample ex)
Gets the aligned words conjoined as strings.

Parameters:
ex - The example whose mentions will have their words aligned.
Returns:
A list of aligned words in the form "wordA_&&_wordB", as computed from getWNAlignedPreModifierPairs(edu.illinois.cs.cogcomp.lbj.coref.ir.examples.CExample).

getWNAlignedPreModifierPairs

public static java.util.List<Pair<java.lang.String,java.lang.String>> getWNAlignedPreModifierPairs(CExample ex)
Aligns each word a in the first mention before its head to each word b in the second mention's extent that is aligned to a according to aligned(java.lang.String, java.lang.String).

Returns:
A list of ordered pairs of aligned word strings, such that the first member of each pair is from the first mention, and the second member is from the second mention.

aligned

public static boolean aligned(java.lang.String a,
                              java.lang.String b)
Determines whether two strings should be aligned; strings should be aligned if they share hypernyms, are both countries, both cities, both first names, or both last names.

Parameters:
a - One string.
b - Another string.
Returns:
Whether the two strings should be aligned.

getWNAlignedPairRelations

public static java.lang.String[] getWNAlignedPairRelations(CExample ex)
Extracts the relations between the aligned words returned by getWNAlignedPreModifierPairs()

Parameters:
ex - The example containing the mentions whose relationship will be computed.
Returns:
An array of strings, each one the name of a relation.

getWNAlignedPairRelations

public static java.lang.String[] getWNAlignedPairRelations(java.util.List<Pair<java.lang.String,java.lang.String>> pairs)
Computes the relations between pairs of words. Possible relations are "match", "substring", "Syn", "Hyp", or "Ant", or "Mismatch".

Parameters:
pairs - The word pairs; a relation will be computed for each pair.
Returns:
An array of strings, each one the name of the relation of the corresponding pair of words.