def get_verb_combinations(map_to_head,term_map): to_combine = [] for head_id, children in map_to_head.iteritems(): head = term_map[head_id] if len(children) == 0 or not is_verb(head.postag): continue for child_id in children: child = term_map[child_id] if is_verb(child.postag) and child.id == (head.id +1): to_combine.append({child.id, head.id}) return get_combinations(to_combine)
def get_verb_combinations(map_to_head,term_map): to_combine = [] for head_id, children in map_to_head.iteritems(): head = term_map[head_id] if not is_verb(head.postag) and head.postag != 'P': continue for child_id in children: child = term_map[child_id] if abs(child.id -head.id) == 1 and (is_verb(child.postag) or child.postag=='P') and not child.ptb_tag[0] == 'N': to_combine.append({child.id, head.id}) return get_combinations(to_combine)
def get_verb_combinations(map_to_head, term_map): to_combine = [] for head_id, children in map_to_head.iteritems(): head = term_map[head_id] if len(children) == 0 or not is_verb(head.postag): continue for child_id in children: child = term_map[child_id] if is_verb(child.postag) and child.id == (head.id + 1): to_combine.append({child.id, head.id}) return get_combinations(to_combine)