edu.washington.cs.knowitall.normalization
Class RelationString
java.lang.Object
edu.washington.cs.knowitall.normalization.RelationString
- All Implemented Interfaces:
- Comparable<RelationString>
public class RelationString
- extends Object
- implements Comparable<RelationString>
Represents a Reverb predicate that contains (1) the original predicate from
the text (2) normalized version (3) POS sequence (modified by Michael
Schmitz)
- Author:
- Jonathan Berant
|
Method Summary |
int |
compareTo(RelationString o)
|
void |
correctNormalization()
Normalizes the predicate - takes predicate normalized by TextRunner and
applies rule based normalization:
if predicate doesn't start with a letter or a abbreviated aux -
return empty predicate
transform to lower case
omit adverbs (RB pos-tag)
omit quasi-modals: "used to VB", "ought to VB", "be able to VB",
"have to VB"
omit modals: (MD pos-tag)
handle "have": change "have VBN/VB/VBD" to "VBD"
handle "be": reverse TextRunner normalization of "be VBN" to
unnormalized form, omit "be" in "be VBG" unless is "be going to VB",
which is treated like a quasi-modal
handle "do": omit "do" in "do VB" expressions
handle "have" again to solve some extreme cases where it needs to be
applied twice ('d have had to have been doing")
if what's left is "be" or "do" or "be be" or "do do" - return empty
predicate since this predicate is not informative
if what's left doesn't start with a letter or a abbreviated aux -
return empty predicate since the extraction was bad
if what's contains "be be " or "do do " or "have have " - return
empty predicate since the extraction was bad
|
boolean |
equals(Object obj)
|
String |
getNormPred()
|
String |
getPosPred()
|
String |
getPred()
|
int |
hashCode()
|
static void |
main(String[] args)
|
void |
setNormPred(String m_normPred)
|
void |
setPosPred(String m_posPred)
|
void |
setPred(String m_pred)
|
void |
setRelationString(RelationString other)
|
String |
toString()
|
RelationString
public RelationString(String m_pred,
String m_normPred,
String m_posPred)
setRelationString
public void setRelationString(RelationString other)
getPred
public String getPred()
setPred
public void setPred(String m_pred)
getNormPred
public String getNormPred()
setNormPred
public void setNormPred(String m_normPred)
getPosPred
public String getPosPred()
setPosPred
public void setPosPred(String m_posPred)
toString
public String toString()
- Overrides:
toString in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
compareTo
public int compareTo(RelationString o)
- Specified by:
compareTo in interface Comparable<RelationString>
correctNormalization
public void correctNormalization()
- Normalizes the predicate - takes predicate normalized by TextRunner and
applies rule based normalization:
- if predicate doesn't start with a letter or a abbreviated aux -
return empty predicate
- transform to lower case
- omit adverbs (RB pos-tag)
- omit quasi-modals: "used to VB", "ought to VB", "be able to VB",
"have to VB"
- omit modals: (MD pos-tag)
- handle "have": change "have VBN/VB/VBD" to "VBD"
- handle "be": reverse TextRunner normalization of "be VBN" to
unnormalized form, omit "be" in "be VBG" unless is "be going to VB",
which is treated like a quasi-modal
- handle "do": omit "do" in "do VB" expressions
- handle "have" again to solve some extreme cases where it needs to be
applied twice ('d have had to have been doing")
- if what's left is "be" or "do" or "be be" or "do do" - return empty
predicate since this predicate is not informative
- if what's left doesn't start with a letter or a abbreviated aux -
return empty predicate since the extraction was bad
- if what's contains "be be " or "do do " or "have have " - return
empty predicate since the extraction was bad
- Throws:
IllegalArgumentException
main
public static void main(String[] args)
Copyright © 2010-2012 University of Washington CSE. All Rights Reserved.