Matej Klemen commited on
Commit
6e8e9d6
1 Parent(s): b8e1a39

Fix bug in parsing of deeper level nested segments

Browse files
Files changed (1) hide show
  1. gkomet.py +3 -2
gkomet.py CHANGED
@@ -114,7 +114,8 @@ def seg_info(sent_el):
114
  if res[0] == EL_LEAF:
115
  latest_element.extend(res[2])
116
  else:
117
- deeper_elements.append(res)
 
118
  latest_element.extend(res[3])
119
 
120
  return ann_type, subtype, deeper_elements, latest_element
@@ -125,7 +126,7 @@ def seg_info(sent_el):
125
  continue
126
 
127
  ann_type, subtype, deeper_elements, latest_element = _resolve_recursively(child_el)
128
- annotations.extend(list(map(lambda _tup: (_tup[0], _tup[1], _tup[3]), deeper_elements)))
129
  annotations.append((ann_type, subtype, latest_element))
130
 
131
  return annotations
 
114
  if res[0] == EL_LEAF:
115
  latest_element.extend(res[2])
116
  else:
117
+ deeper_elements.extend(res[2])
118
+ deeper_elements.append((res[0], res[1], res[3]))
119
  latest_element.extend(res[3])
120
 
121
  return ann_type, subtype, deeper_elements, latest_element
 
126
  continue
127
 
128
  ann_type, subtype, deeper_elements, latest_element = _resolve_recursively(child_el)
129
+ annotations.extend(deeper_elements)
130
  annotations.append((ann_type, subtype, latest_element))
131
 
132
  return annotations