Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- intransitive_dict = {}
- def is_intrans(d):
- root = list(filter(lambda x: x.head==x, [t for t in d]))[0]
- if root.pos_ == 'VERB':
- children = list(filter(lambda x: x.root.dep_ == 'dobj' and x.root.head == root, d.noun_chunks))
- if not children:
- # intransitive case
- if root.lemma_ in intransitive_dict.keys(): intransitive_dict[root.lemma_] = intransitive_dict[root.lemma_] + 1
- else: intransitive_dict[root.lemma_] = 1
- elif len(children) == 1:
- # transitive case
- ...
- elif len(children) == 2:
- # bitransitive case
- ...
Add Comment
Please, Sign In to add comment