edu.upenn.cis.ptb
Interface PTBLabel
- All Known Subinterfaces:
- SPTBLabel
- All Known Implementing Classes:
- PTBLabelImpl, SPTBLabelImpl
- public interface PTBLabel
The label associated with a PTBTreeNode. The use of
the various fields are explained in the PTBAttribute
interface. Here are some examples:
Example 1:
raw: S-NOM-SBJ
type: S
roles: -NOM-SBJ
movementIndex: -1
gapIndex: -1
Example 2:
raw: S-TPC=2-3
type: S
roles: -TPC
movementIndex: 3
gapIndex: 2
Example 3: (Preterminal)
raw: -NONE-
type:
roles: -NONE-
movementIndex: -1
gapIndex: -1
Example 4: (Terminal)
raw: *ICH*-1
type: *ICH*
roles:
movementIndex: 1
gapIndex: -1
Example 5: (Terminal)
raw: Vinken
type: Vinken
roles:
movementIndex: -1
gapIndex: -1
For XPath queries, all these fields are treated as attributes of a PTBTreeNode.
The name of the node is the type field. The attributes
movementIndex and gapIndex are considered to
exist iff they don't have the value -1. This makes it convenient, for example, to
search for all sentences containing a gap using the XPath expression
.[=>>::*[@gapIndex]]
Version 2 Changes: A method updateAttributesOnNode
has been removed for performance reasons, and the corresponding
methods removed from the PTBTreeNode interface.
- Since:
- 0.1
- Version:
- 2
- Author:
- nikhild
- See Also:
PTBAttribute,
PTBTreeNode
getRaw
public java.lang.String getRaw()
getType
public java.lang.String getType()
getRoles
public java.lang.String getRoles()
hasRole
public boolean hasRole(java.lang.String role)
getMovementIndex
public int getMovementIndex()
hasMovementIndex
public boolean hasMovementIndex()
getGapIndex
public int getGapIndex()
hasGapIndex
public boolean hasGapIndex()
getOwnerNode
public PTBTreeNode getOwnerNode()
setOwnerNode
public void setOwnerNode(PTBTreeNode owner)
save
public void save(java.io.Writer writer)
throws java.io.IOException
- Throws:
java.io.IOException