modules/NLP.py
def traverse_obj_children(self, tok, verb_path):
        '''
        iterate over all the children and the conjuncts to return objects within the same chain of verbs
        :param tok:
        :param verb_path:
        :return:
        '''
        for i in tok.children:
            # print i, verb_path, get_verb_path_from_ancestors(i), get_verb_path_from_ancestors(i) ==verb_path
            if i.dep_ in OBJECTS and (self.get_verb_path_from_ancestors(i) == verb_path):
                yield i
            else:
                self.traverse_obj_children(i, verb_path)
        for i in tok.conjuncts:
            # print i, verb_path, get_verb_path_from_ancestors(i), get_verb_path_from_ancestors(i) ==verb_path
            if i.dep_ in OBJECTS and (self.get_verb_path_from_ancestors(i) == verb_path):
                yield i
            else:
                self.traverse_obj_children(i, verb_path)

        iterate over all the children and the conjuncts to return objects within the same chain of verbs
        :param tok:
        :param verb_path:
        :return:
        
iterate over all the children and the conjuncts to return objects within the same chain of verbs
iterate over all the children and the conjuncts to return objects within the same chain of verbs
def traverse_obj_children(self, tok, verb_path):
        for i in tok.children:
            if i.dep_ in OBJECTS and (self.get_verb_path_from_ancestors(i) == verb_path):
                yield i
            else:
                self.traverse_obj_children(i, verb_path)
        for i in tok.conjuncts:
            if i.dep_ in OBJECTS and (self.get_verb_path_from_ancestors(i) == verb_path):
                yield i
            else:
                self.traverse_obj_children(i, verb_path)
def traverse_obj_children ( self , tok , verb_path ) : for i in tok . children : if i . dep_ in OBJECTS and ( self . get_verb_path_from_ancestors ( i ) == verb_path ) : yield i else : self . traverse_obj_children ( i , verb_path ) for i in tok . conjuncts : if i . dep_ in OBJECTS and ( self . get_verb_path_from_ancestors ( i ) == verb_path ) : yield i else : self . traverse_obj_children ( i , verb_path )
iterate over all the children and the conjuncts to return objects within the same chain of verbs
iterate over all the children and the conjuncts to return objects within the same chain of verbs
'''
        iterate over all the children and the conjuncts to return objects within the same chain of verbs
        :param tok:
        :param verb_path:
        :return:
        ''' # print i, verb_path, get_verb_path_from_ancestors(i), get_verb_path_from_ancestors(i) ==verb_path # print i, verb_path, get_verb_path_from_ancestors(i), get_verb_path_from_ancestors(i) ==verb_path
None
self
tok
None
verb_path
None