Commits

Hiroyoshi Komatsu committed 895cf22 Merge

Merged in rangius/corenlp-python (pull request #5)

Include a dictionary of dependencies having indexed words

Comments (0)

Files changed (1)

         line = line.strip()
 
         if line.startswith("Sentence #"):
-            sentence = {'words': [], 'parsetree': [], 'dependencies': []}
+            sentence = {'words': [], 'parsetree': [], 'dependencies': [], 'indexeddependencies': []}
             results["sentences"].append(sentence)
             state = STATE_TEXT
 
                 if len(split_entry) == 3:
                     rel, left, right = map(lambda x: remove_id(x), split_entry)
                     sentence['dependencies'].append(tuple([rel, left, right]))
+                    sentence['indexeddependencies'].append(tuple(split_entry))
 
         elif state == STATE_COREFERENCE:
             if "Coreference set" in line: