edu.illinois.cs.cogcomp.lbj.coref.ir
Class MentionSpecificityComparator

java.lang.Object
  extended by edu.illinois.cs.cogcomp.lbj.coref.ir.MentionSpecificityComparator
All Implemented Interfaces:
java.util.Comparator<Mention>

public class MentionSpecificityComparator
extends java.lang.Object
implements java.util.Comparator<Mention>

Determines which mention is a more specific mention of an entity. Specificity is defined as having a more specific mention type Proper names are more specific than nominals, which are more specific than pronouns; or if not more specific, being longer. NOTE: Two mentions do not need to be coreferential for their specificities to be compared.


Constructor Summary
MentionSpecificityComparator()
          Constructs a mention specificity comparator.
 
Method Summary
 int compare(Mention a, Mention b)
          Compares mentions by specificity in descending order.
protected  int compareBySpecificity(Mention a, Mention b)
          Determines which mention is more specific, in ascending order.
protected  boolean moreSpecificSameType(Mention a, Mention b)
          Determines whether a is more specific than b, given that they have the same mention type.
protected  boolean moreSpecificType(Mention a, Mention b)
          Determines whether a's mention type is strictly more specific than b's.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

MentionSpecificityComparator

public MentionSpecificityComparator()
Constructs a mention specificity comparator.

Method Detail

compare

public int compare(Mention a,
                   Mention b)
Compares mentions by specificity in descending order. Specificity is defined as having a more specific mention type Proper names are more specific than nominals, which are more specific than pronouns; or if not more specific, being longer.

Specified by:
compare in interface java.util.Comparator<Mention>
Parameters:
a - A mention.
b - Another mention.
Returns:
-1 if a is more specific 0 if they are the same and 1 if b is more specific.

compareBySpecificity

protected int compareBySpecificity(Mention a,
                                   Mention b)
Determines which mention is more specific, in ascending order. Specificity is defined as having a more specific mention type Proper names are more specific than nominals, which are more specific than pronouns; or if not more specific, being longer. Arguments may be null, and null is always the least specific.

Parameters:
a - A mention.
b - Another mention.
Returns:
-1 if a is strictly less specific than b, 0 if their specificities are the same, or 1 if a is more specific.

moreSpecificSameType

protected boolean moreSpecificSameType(Mention a,
                                       Mention b)
Determines whether a is more specific than b, given that they have the same mention type.

Parameters:
a - A mention.
b - Another mention.
Returns:
true when a is strictly more specific that b, assuming their mention types are equivalent.

moreSpecificType

protected boolean moreSpecificType(Mention a,
                                   Mention b)
Determines whether a's mention type is strictly more specific than b's. Mention types, in decreasing order of specificity: NAM, NOM, PRE, PRO, NONE

Parameters:
a - A mention.
b - Another mention.
Returns:
true when a's mention type is strictly more specific than b's.