public class Linkage
extends java.lang.Object
Linkage(int, Sentence, ParseOptions)
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Linkage.LinkageAndList |
Modifier and Type | Field and Description |
---|---|
static Linkage.LinkageAndList[] |
andlist |
int |
current
Allows user to select particular sublinkage
|
LinkageInfo |
info
index and cost information
|
int |
num_sublinkages
One for thin linkages, bigger for fat
|
ParseOptions |
opts |
static char[][] |
picture |
Sentence |
sent |
Sublinkage[] |
sublinkage
A parse with conjunctions will have several
|
boolean |
unionized
if true, union of links has been computed
|
java.util.ArrayList<java.lang.String> |
word
array of word spellings
|
static int[] |
wordtype |
static char[][] |
xpicture |
Constructor and Description |
---|
Linkage(int k,
Sentence sent,
ParseOptions opts) |
Modifier and Type | Method and Description |
---|---|
void |
adjust_subordinate_clauses(int numcon_total,
int numcon_subl) |
java.lang.String |
build_linkage_postscript_string()
builds a postscript printable string of the current sublinkage
|
(package private) void |
compute_chosen_words(Sentence sent) |
void |
extract_fat_linkage(Sentence sent,
ParseOptions opts)
The old C comment said -- This procedure mimics analyze_fat_linkage in order to
extract the sublinkages and copy them to the Linkage
data structure passed in.
|
(package private) static void |
extract_links(int index,
int cost,
ParseInfo pi)
Generate the list of all links of the indexth parsing of the
sentence.
|
(package private) void |
extract_thin_linkage(Sentence sent,
ParseOptions opts)
extract thin links from a sentence
|
java.lang.String |
header(int mode)
Supplies the postscript header used when generating a postscript output file
|
(package private) boolean |
link_already_appears(Link link,
int a) |
int |
linkage_and_cost() |
int |
linkage_compute_union()
computes the union of the current sublinkages.
|
CNode |
linkage_constituent_tree()
CNode linkage_constituent_tree();
The other useful method for dealing with a cosntituent tree is:
String linkage_print_constituent_tree(int mode);
|
int |
linkage_disjunct_cost() |
java.lang.String[] |
linkage_get_link_domain_names(int index) |
java.lang.String |
linkage_get_link_label(int index) |
java.lang.String |
linkage_get_link_llabel(int index) |
int |
linkage_get_link_lword(int index) |
int |
linkage_get_link_num_domains(int index) |
java.lang.String |
linkage_get_link_rlabel(int index) |
int |
linkage_get_link_rword(int index) |
int |
linkage_get_num_links()
This is need to set up the for loop to walk down a set of
links for printing or other processing
returns the size of the linkage array as the number of links
|
int |
linkage_get_num_sublinkages()
This is a toplevel routine used to setup a for loop
to process each sublinkage (usually an AND disjunct).
|
int |
linkage_get_num_words()
Gives the number or word spellings or individual word spellings for the
current sublinkage
|
Sentence |
linkage_get_sentence()
getter for the sentence from an instantiated linkage
|
java.lang.String |
linkage_get_violation_name() |
java.lang.String |
linkage_get_word(int w) |
boolean |
linkage_has_inconsistent_domains() |
boolean |
linkage_is_canonical() |
boolean |
linkage_is_improper() |
int |
linkage_link_cost() |
void |
linkage_post_process(Postprocessor postprocessor)
post process the sublinkages according to the named postprocessor
|
java.lang.String |
linkage_print_constituent_tree(int mode)
String linkage_print_constituent_tree(int mode)
|
java.lang.String |
linkage_print_diagram() |
java.lang.String |
linkage_print_links_and_domains() |
java.lang.String |
linkage_print_postscript(int mode)
Print out a postscript version of the constituent tree
|
boolean |
linkage_set_current_sublinkage(int index)
setter function to set the current sublinkage to indicated index
TODO - does this function have to insure a compact array? If so
should it return the next available index?
|
int |
linkage_unused_word_cost() |
(package private) boolean |
links_are_equal(Link l,
Link m) |
CNode |
parse_string(CNode n,
java.util.StringTokenizer tok) |
void |
print_a_link(java.lang.StringBuffer s,
int link)
Prints the information contained in a link into a supplied string buffer.
|
void |
process_linkage(ParseOptions opts) |
void |
set_centers(boolean print_word_0) |
void |
setParseOptions(ParseOptions opts)
setter for object's copy of the ParseOptions
|
void |
setSentence(Sentence sent)
setter for object's copy of the sentence
|
(package private) int |
token_type(java.lang.String token) |
java.lang.String |
trailer(int mode) |
(package private) Sublinkage |
unionize_linkage() |
static boolean |
uppercompare(java.lang.String s,
java.lang.String t) |
public java.util.ArrayList<java.lang.String> word
public LinkageInfo info
public int num_sublinkages
public int current
public Sublinkage[] sublinkage
public boolean unionized
public Sentence sent
public ParseOptions opts
public static Linkage.LinkageAndList[] andlist
public static int[] wordtype
public static char[][] picture
public static char[][] xpicture
public Linkage(int k, Sentence sent, ParseOptions opts)
public void setSentence(Sentence sent)
sent
- public void setParseOptions(ParseOptions opts)
opts
- void compute_chosen_words(Sentence sent)
static void extract_links(int index, int cost, ParseInfo pi)
void extract_thin_linkage(Sentence sent, ParseOptions opts)
sent
- sentence to extract links from.
TODO - does not set the current Linkage objects this.sent to sent. This may be a bug!opts
- options to use when processing
TODO - does not set the current Linkage objects this.opts to opts. This may be a bug!public void extract_fat_linkage(Sentence sent, ParseOptions opts)
sent
- sentence to extract links from.
TODO - does not set the current Linkage objects this.sent to sent. This may be a bug!opts
- options to use when processing
TODO - does not set the current Linkage objects this.opts to opts. This may be a bug!public int linkage_unused_word_cost()
public int linkage_disjunct_cost()
public int linkage_and_cost()
public int linkage_link_cost()
public int linkage_get_num_sublinkages()
public int linkage_get_num_words()
public int linkage_get_num_links()
public boolean linkage_set_current_sublinkage(int index)
public Sentence linkage_get_sentence()
boolean link_already_appears(Link link, int a)
Sublinkage unionize_linkage()
public int linkage_compute_union()
public void process_linkage(ParseOptions opts)
public java.lang.String linkage_get_word(int w)
public java.lang.String linkage_get_link_label(int index)
public java.lang.String linkage_get_link_llabel(int index)
public java.lang.String linkage_get_link_rlabel(int index)
public int linkage_get_link_rword(int index)
public int linkage_get_link_lword(int index)
public int linkage_get_link_num_domains(int index)
public java.lang.String[] linkage_get_link_domain_names(int index)
public java.lang.String linkage_get_violation_name()
public boolean linkage_is_canonical()
public boolean linkage_is_improper()
public boolean linkage_has_inconsistent_domains()
public java.lang.String linkage_print_links_and_domains()
public void print_a_link(java.lang.StringBuffer s, int link)
s
- Empty stringbuffer supplied by the caller shich the method will uselink
- the index of the linkpublic java.lang.String build_linkage_postscript_string()
public void set_centers(boolean print_word_0)
public java.lang.String linkage_print_diagram()
public java.lang.String linkage_print_constituent_tree(int mode)
mode
- mode 1: treebank-style constituent tree
mode 2: flat, bracketed tree [A like [B this B] A]
mode 3: flat, treebank-style tree (A like (B this) )int token_type(java.lang.String token)
public CNode linkage_constituent_tree()
public java.lang.String linkage_print_postscript(int mode)
mode
- mode 1: treebank-style constituent tree
mode 2: flat, bracketed tree [A like [B this B] A]
mode 3: flat, treebank-style tree (A like (B this) )public void adjust_subordinate_clauses(int numcon_total, int numcon_subl)
public static boolean uppercompare(java.lang.String s, java.lang.String t)
public void linkage_post_process(Postprocessor postprocessor)
public java.lang.String trailer(int mode)
public java.lang.String header(int mode)
mode
- Print out the constituent tree.
mode 1: treebank-style constituent tree
mode 2: flat, bracketed tree [A like [B this B] A]
mode 3: flat, treebank-style tree (A like (B this) )