doctable.parsetree
index
/scratch/dc326/code/doctable/doctable/parsetree.py

 
Classes
       
builtins.object
ParseTree
Token

 
class ParseTree(builtins.object)
     Methods defined here:
__getitem__(self, ind)
Returns ith item in ordered list of _tokens.
__init__(self, root_node, *args, **kwargs)
Create from dict parsetree or spacy sentence root.
__iter__(self)
__len__(self)
__repr__(self)
Return repr(self).
__str__(self)
Return str(self).
bubble_accum(self, func)
Applies func to each node and bubbles up accumulated result (like reduce).
Args:
    func (function): apply function to an object returning list.
bubble_reduce(self, func, init_data)
Applies func to each node and bubbles up accumulated list of results.
Args:
    func (function): apply function to an object returning list.
    init_data (any type): initial data to pass through reduce function
display(self, pad=15, base=10, **kwargs)
Print out an ascii tree.
to_dict(self)

Class methods defined here:
print_tree_recursive(tok, pad, base, level=0, root_str='{text}', dep_str=' -{dep}> {text}') from builtins.type

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
toks
List of token texts.

Data and other attributes defined here:
root = None

 
class Token(builtins.object)
     Methods defined here:
__getitem__(self, ind)
__init__(self, node, tok_parse_func=None, info_func_map={}, parent=None)
Construct from either a dictionary or spacy token.
__iter__(self)
__repr__(self)
Return repr(self).
__str__(self)
Return str(self).
bubble_accum(self, func)
bubble_reduce(self, func, agg_data)
to_dict(self)
Convert self to a dict.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
ent
pos

Data and other attributes defined here:
childs = []
dep = None
i = None
info = None
parent = None
tag = None
text = None

 
Functions
       
reduce(...)
reduce(function, sequence[, initial]) -> value
 
Apply a function of two arguments cumulatively to the items of a sequence,
from left to right, so as to reduce the sequence to a single value.
For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
of the sequence in the calculation, and serves as a default when the
sequence is empty.