public class SyntacticRelationSet extends Object
| Modifier and Type | Field and Description |
|---|---|
static HashMap |
nomVmap |
static String[] |
relationTypes |
static boolean |
useBaseForm |
static boolean |
usePA |
| Constructor and Description |
|---|
SyntacticRelationSet() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(SyntacticRelation r)
adds a SyntacticRelation to the set.
|
void |
addAll(Collection c)
adds all the elements of
c, which should be
SyntacticRelations, to the set. |
void |
addInverses()
for each relation in the SyntacticRelationSet of the form 'X rel Y', adds
an inverse relation of the form 'Y rel-1 X'.
|
void |
addRelations(Document doc)
search Document
doc for syntactic relatioms (encoded
as features on annotations) and add them to the SyntacticRelationSet. |
boolean |
equals(Object o) |
SyntacticRelation |
get(int i)
returns the i-th relation in the set, where i is non-negative
and less than the size of the set.
|
SyntacticRelation |
getRelation(int from,
int to)
return the first relation whose source is at position
from
and whose target is at position to, or null
if no such relation exists. |
SyntacticRelation |
getRelation(int from,
String type)
return the first relation whose source is at position
from
and whose type is type, or null
if no such relation exists. |
SyntacticRelationSet |
getRelationsFrom(int from)
return a SyntacticRelationSet containing those relations whose source
is at position
from. |
SyntacticRelation |
getRelationTo(int to)
return the first relation whose target is at position
to
or null if no such relation exists. |
int |
hashCode() |
static void |
main(String[] args) |
void |
read(BufferedReader br)
reads the SyntacticRelationSet from BufferedReader
br. |
void |
readRelations(String fileName)
reads relations (in GLARF tuple format) from 'fileName'.
|
int |
size()
returns the number of SyntacticRelations in the set.
|
String |
toString()
return a printable version of the SyntacticRelationSet.
|
void |
write(PrintWriter pw) |
public static String[] relationTypes
public static HashMap nomVmap
public static boolean usePA
public static boolean useBaseForm
public void addRelations(Document doc)
doc for syntactic relatioms (encoded
as features on annotations) and add them to the SyntacticRelationSet.
Looks for features on the list relationTypes.public void add(SyntacticRelation r)
public void addAll(Collection c)
c, which should be
SyntacticRelations, to the set.public int size()
public SyntacticRelation get(int i)
public SyntacticRelation getRelation(int from, int to)
from
and whose target is at position to, or null
if no such relation exists.public SyntacticRelation getRelation(int from, String type)
from
and whose type is type, or null
if no such relation exists.public SyntacticRelationSet getRelationsFrom(int from)
from.public SyntacticRelation getRelationTo(int to)
to
or null if no such relation exists.public String toString()
public void write(PrintWriter pw)
public void read(BufferedReader br) throws IOException
br. The
input should be one relation per line, consisting of 5 fields separated
by "|".IOExceptionpublic void readRelations(String fileName)
public void addInverses()
public static void main(String[] args)
Copyright © 2016 New York University. All rights reserved.