Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion corenlp/corenlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ def extract_words_from_xml(sent_node):
# Making a raw sentence list of dictionaries:
raw_sent_list = document[u'sentences'][u'sentence']

if type(raw_sent_list) != list:
raw_sent_list = [raw_sent_list]

# Convert sentences to the format like python
# TODO: If there is only one sentence in input sentence,
# raw_sent_list is dict and cannot decode following code...
sentences = [{'dependencies': [[dep['dep'][i]['@type'],
dep['dep'][i]['governor']['#text'],
Expand Down