Commits

Riccardo Angius committed 4d85fdd

Added additional dict of dependencies keeping the original indexing

  • Participants
  • Parent commits 8462899

Comments (0)

Files changed (1)

corenlp/corenlp.py

         line = line.strip()
 
         if line.startswith("Sentence #"):
-            sentence = {'words': [], 'parsetree': [], 'dependencies': []}
+            sentence = {'words': [], 'parsetree': [], 'dependencies': [], 'indexeddependencies': []}
             results["sentences"].append(sentence)
             state = STATE_TEXT
 
                     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:
                 if 'coref' not in results: