|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.upenn.cis.propbank_shen.ArgLoc
public class ArgLoc
This class represents a location of an argument in the text.
Basically, locations just represent spans in the text, but there are some complications. For example, sometimes arguments are associated with more than one span, such as the "utterance" argument of the verb "say" in the sentence "'I'm going home', John said, 'before 10PM'."
Here,
"I'm going home ... before 10PM" is not a continuous span,
so the ArgLoc
will consist of two spans.
The second situation is for resolving empty constituents and sentence local anaphora. We consider the sentence "John is going to swim". The syntactic representation of this sentence adds a pseudo subject to the infinitive "to swim", with a pointer to "John". However, since WH-movement was not explicitly marked in the Penn treebank, we have marked this situation as well in the form of declaring that a set of nodes have equivalent semantic content. For example, in the sentence
Thus in short, we may view the data structure for a location in the text associated with an argument in a predicate argument structure as exactly one of the following three cases:
WordSpan
Field Summary | |
---|---|
static int |
CONCAT
|
static int |
EQUIVA
|
protected int |
loc_type
|
protected List |
locs
|
static int |
SINGLE
|
protected WordSpan |
ta
|
Constructor Summary | |
---|---|
ArgLoc(int ltype,
List alocs)
construct an argument location from a loc_type and a list of other ArgLoc objects. |
|
ArgLoc(WordSpan ta)
construct an argument location from a basic argument location |
Method Summary | |
---|---|
int |
compareTo(Object o)
Compares argument locations. |
boolean |
equals(Object o)
|
List |
getAllWordSpans()
returns a flat list of all WordSpans contained somewhere (possibly deeply nested) in this ArgLoc |
List |
getLocList()
Returns a list of other ArgLoc objects if this location consists of multiple nodes. |
WordSpan |
getWordSpan()
Returns the unique WordSpan if this location consists of just one span. |
boolean |
isConcat()
return true if this location consists of several word spans. |
boolean |
isSingle()
return true if this location consists of a single word span. |
boolean |
isTraceChain()
return true if this location consists of a trace chain |
static int |
locTypeOfstring(String s)
create a loc_type from a canoncial string or throw CorruptDataException if this is an invalid string |
String |
locTypeToString()
return a canoncial string for a location type: the empty string for SINGLE, a comma for CONCAT, an asterisk for EQUIVA. |
static ArgLoc |
ofString(String s)
convert a string to an ArgLoc if possible, otherwise throw CorruptDataException. |
String |
toString()
create a string representation of the argument location. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SINGLE
public static final int CONCAT
public static final int EQUIVA
protected int loc_type
protected List locs
protected WordSpan ta
Constructor Detail |
---|
public ArgLoc(WordSpan ta)
public ArgLoc(int ltype, List alocs)
Method Detail |
---|
public boolean isSingle()
public boolean isConcat()
public boolean isTraceChain()
public WordSpan getWordSpan()
WordSpan
if this location consists of just one span.
Otherwise, returns null.
public List getLocList()
public String locTypeToString()
public static int locTypeOfstring(String s) throws CorruptDataException
CorruptDataException
public int compareTo(Object o)
compareTo
in interface Comparable
public List getAllWordSpans()
public String toString()
toString
in class Object
public static ArgLoc ofString(String s) throws CorruptDataException
s
- the string to be converted.
CorruptDataException
public boolean equals(Object o)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |