示例#1
0
class RelationsTransformator(InplaceTreeTransformator):
    def __init__(self):
        from yargy.relations.graph import TokenRelationsGraph
        self.relations = TokenRelationsGraph()

    def __call__(self, tree):
        for item in tree.walk():
            self.visit(item)
        return self.relations

    def visit_Node(self, item):
        if item.relation:
            self.relations.add(item.relation, item.main)
示例#2
0
class RelationsTransformator(InplaceTreeTransformator):
    def __init__(self):
        from yargy.relations.graph import TokenRelationsGraph
        self.relations = TokenRelationsGraph()

    def __call__(self, tree):
        for item in tree.walk():
            self.visit(item)
        return self.relations

    def visit_Node(self, item):
        if item.relation:
            self.relations.add(item.relation, item.main)
示例#3
0
 def __init__(self):
     from yargy.relations.graph import TokenRelationsGraph
     self.relations = TokenRelationsGraph()
示例#4
0
 def __init__(self):
     from yargy.relations.graph import TokenRelationsGraph
     self.relations = TokenRelationsGraph()