daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.             ...
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top