Guest User

Untitled

a guest
Mar 14th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. intransitive_dict = {}
  2.  
  3. def is_intrans(d):
  4. root = list(filter(lambda x: x.head==x, [t for t in d]))[0]
  5. if root.pos_ == 'VERB':
  6. children = list(filter(lambda x: x.root.dep_ == 'dobj' and x.root.head == root, d.noun_chunks))
  7. if not children:
  8. # intransitive case
  9. if root.lemma_ in intransitive_dict.keys(): intransitive_dict[root.lemma_] = intransitive_dict[root.lemma_] + 1
  10. else: intransitive_dict[root.lemma_] = 1
  11. elif len(children) == 1:
  12. # transitive case
  13. ...
  14. elif len(children) == 2:
  15. # bitransitive case
  16. ...
Add Comment
Please, Sign In to add comment