edu.upenn.cis.propbank_shen
Class ArgLoc

java.lang.Object
  extended by edu.upenn.cis.propbank_shen.ArgLoc
All Implemented Interfaces:
Comparable

public class ArgLoc
extends Object
implements Comparable

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

"The man who swam the mile died"
Our treebank would declare that "who" is the subject of "swam", but not that "who" refered to the same thing as "the man". So we mark all the nodes, the node containing "who", the node containing "the man", and the associated empty constituent as nodes which denote the same thing.

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:

  1. a singleton span
  2. a set of spans arranged together
  3. a set of spans referring to the same semantic entity.

Author:
Scott Cotton
See Also:
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

SINGLE

public static final int SINGLE
See Also:
Constant Field Values

CONCAT

public static final int CONCAT
See Also:
Constant Field Values

EQUIVA

public static final int EQUIVA
See Also:
Constant Field Values

loc_type

protected int loc_type

locs

protected List locs

ta

protected WordSpan ta
Constructor Detail

ArgLoc

public ArgLoc(WordSpan ta)
construct an argument location from a basic argument location


ArgLoc

public ArgLoc(int ltype,
              List alocs)
construct an argument location from a loc_type and a list of other ArgLoc objects. List must contain at least two elements, and ltype must be CONCAT or EQUIVA.

Method Detail

isSingle

public boolean isSingle()
return true if this location consists of a single word span.


isConcat

public boolean isConcat()
return true if this location consists of several word spans.


isTraceChain

public boolean isTraceChain()
return true if this location consists of a trace chain


getWordSpan

public WordSpan getWordSpan()
Returns the unique WordSpan if this location consists of just one span. Otherwise, returns null.


getLocList

public List getLocList()
Returns a list of other ArgLoc objects if this location consists of multiple nodes. Otherwise, return null.


locTypeToString

public String locTypeToString()
return a canoncial string for a location type: the empty string for SINGLE, a comma for CONCAT, an asterisk for EQUIVA. These strings are used as separators in the representation of word spans.


locTypeOfstring

public static int locTypeOfstring(String s)
                           throws CorruptDataException
create a loc_type from a canoncial string or throw CorruptDataException if this is an invalid string

Throws:
CorruptDataException

compareTo

public int compareTo(Object o)
Compares argument locations. We compare by the earliest node anywhere in the (possible nested) structure of the ArgLoc.

Specified by:
compareTo in interface Comparable

getAllWordSpans

public List getAllWordSpans()
returns a flat list of all WordSpans contained somewhere (possibly deeply nested) in this ArgLoc


toString

public String toString()
create a string representation of the argument location.

Overrides:
toString in class Object

ofString

public static ArgLoc ofString(String s)
                       throws CorruptDataException
convert a string to an ArgLoc if possible, otherwise throw CorruptDataException.

Parameters:
s - the string to be converted.
Throws:
CorruptDataException

equals

public boolean equals(Object o)
Overrides:
equals in class Object