Package jazzparser :: Package data :: Module dependencies
[hide private]
[frames] | no frames]

Module dependencies

source code

Data structures for dependency graphs.


Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>

Classes [hide private]
  DependencyGraph
Data structure to represent dependency graphs.
  MaltTabReadError
Functions [hide private]
 
malt_tab_to_dependency_graphs(data)
Reads in data in the Malt-TAB format, as used by the Malt Parser, and returns a list of dependency graphs.
source code
 
dependency_graph_to_latex(graph, words=[], number_nodes=False, fmt_lab=<type 'str'>, graph_id=None, extra_rows=[])
Output a latex representation of the dependency graph to typeset it using tikz-dependency.
source code
 
optimal_node_alignment(graph1, graph2, label_compare=<function <lambda> at 0x42cd410>)
Produces the alignment between the nodes of the two dependency graphs that maximizes the shared dependencies.
source code
 
alignment_to_graph(node_pairs, graph1, graph2, label_compare=<function <lambda> at 0x42cd500>)
Given a list of pairs of aligned nodes, as returned by optimal_node_alignment, produces the dependency graph that contains only the shared dependencies.
source code
Variables [hide private]
  __package__ = None
hash(x)
Function Details [hide private]

malt_tab_to_dependency_graphs(data)

source code 

Reads in data in the Malt-TAB format, as used by the Malt Parser, and returns a list of dependency graphs.

A error will be raised if the input is in two-column format, because you can't build a dependency graph from that.

Parameters:
  • data (string) - file content

See Also: http://w3.msi.vxu.se/~nivre/research/MaltXML.html

optimal_node_alignment(graph1, graph2, label_compare=<function <lambda> at 0x42cd410>)

source code 

Produces the alignment between the nodes of the two dependency graphs that maximizes the shared dependencies.

Returns a list of aligned pairs of node indices, using None to represent deletions/insertions.

alignment_to_graph(node_pairs, graph1, graph2, label_compare=<function <lambda> at 0x42cd500>)

source code 

Given a list of pairs of aligned nodes, as returned by optimal_node_alignment, produces the dependency graph that contains only the shared dependencies. The node indices do not, of course, correspond to those in the input graphs, so we also return a mapping from the node indices in the common graph to those in each of the other graphs.