def __init__(self, linkage_swig_obj, null_count=0): # XXX FIXME Most of the initialization below just wastes CPU time, # especially if the user does not need this stuff. self.num_of_words = clg.linkage_get_num_words(linkage_swig_obj) self.num_of_links = clg.linkage_get_num_links(linkage_swig_obj) self.link_cost = clg.linkage_link_cost(linkage_swig_obj) self.words = [ clg.linkage_get_word(linkage_swig_obj, i) for i in range(self.num_of_words) ] self.links = [ Link(self.words[clg.linkage_get_link_lword(linkage_swig_obj, i)], clg.linkage_get_link_llabel(linkage_swig_obj, i), clg.linkage_get_link_rlabel(linkage_swig_obj, i), self.words[clg.linkage_get_link_rword(linkage_swig_obj, i)]) for i in range(self.num_of_links) ] self.null_count = null_count self.link_distances = [ clg.linkage_get_link_length(linkage_swig_obj, i) for i in range(self.num_of_links) ] # XXX FIXME: doing the below, if not needed, is a bit of a cpu-waster! # # display_walls=0, screen_width=180 self.diagram = clg.linkage_print_diagram(linkage_swig_obj, 0, 180) self.senses = clg.linkage_print_senses(linkage_swig_obj) self.links_and_domains = clg.linkage_print_links_and_domains( linkage_swig_obj)
def __init__(self, linkage_swig_obj, calculate_sub_linkages=True, null_count=0): # XXX FIXME Most of the initialization below just wastes CPU time, # especially if the user does not need this stuff. self.num_of_words = clg.linkage_get_num_words(linkage_swig_obj) self.num_of_links = clg.linkage_get_num_links(linkage_swig_obj) self.link_cost = clg.linkage_link_cost(linkage_swig_obj) self.words = [clg.linkage_get_word(linkage_swig_obj,i) for i in range(self.num_of_words)] self.links = [Link(self.words[clg.linkage_get_link_lword(linkage_swig_obj,i)], clg.linkage_get_link_llabel(linkage_swig_obj,i), clg.linkage_get_link_rlabel(linkage_swig_obj,i), self.words[clg.linkage_get_link_rword(linkage_swig_obj,i)]) for i in range(self.num_of_links)] self.null_count = null_count self.link_distances = [clg.linkage_get_link_length(linkage_swig_obj, i) for i in range(self.num_of_links)] # XXX FIXME: doing the below, if not needed, is a bit of a cpu-waster! # # display_walls=0, screen_width=180 self.diagram = clg.linkage_print_diagram(linkage_swig_obj, False, 180) self.senses = clg.linkage_print_senses(linkage_swig_obj) self.links_and_domains = clg.linkage_print_links_and_domains(linkage_swig_obj) # Disable postscript. Lets be real, no one will use this. # self.postscript_snippet = clg.linkage_print_postscript(linkage_swig_obj, 1, 0) # self.postscript = clg.linkage_print_postscript(linkage_swig_obj, 1, 1) self.constituent_phrases_nested = clg.linkage_print_constituent_tree(linkage_swig_obj, 1)
def __init__(self, linkage_swig_obj, null_count=0): # XXX FIXME Most of the initialization below just wastes CPU time, # especially if the user does not need this stuff. self.num_of_words = clg.linkage_get_num_words(linkage_swig_obj) self.num_of_links = clg.linkage_get_num_links(linkage_swig_obj) self.link_cost = clg.linkage_link_cost(linkage_swig_obj) self.words = [clg.linkage_get_word(linkage_swig_obj,i) for i in range(self.num_of_words)] self.links = [Link(self.words[clg.linkage_get_link_lword(linkage_swig_obj,i)], clg.linkage_get_link_llabel(linkage_swig_obj,i), clg.linkage_get_link_rlabel(linkage_swig_obj,i), self.words[clg.linkage_get_link_rword(linkage_swig_obj,i)]) for i in range(self.num_of_links)] self.null_count = null_count self.link_distances = [clg.linkage_get_link_length(linkage_swig_obj, i) for i in range(self.num_of_links)] # XXX FIXME: doing the below, if not needed, is a bit of a cpu-waster! # # display_walls=0, screen_width=180 self.diagram = clg.linkage_print_diagram(linkage_swig_obj, 0, 180) self.senses = clg.linkage_print_senses(linkage_swig_obj) self.links_and_domains = clg.linkage_print_links_and_domains(linkage_swig_obj)
def linkage_link_cost(*args) -> "int" : return _clinkgrammar.linkage_link_cost(*args)
def linkage_link_cost(*args): return _clinkgrammar.linkage_link_cost(*args)
def linkage_link_cost(linkage): return _clinkgrammar.linkage_link_cost(linkage)
def link_cost(self): return clg.linkage_link_cost(self._obj)
def linkage_link_cost(linkage: 'Linkage const') -> "int": return _clinkgrammar.linkage_link_cost(linkage)
def linkage_link_cost(*args) -> "int": return _clinkgrammar.linkage_link_cost(*args)