We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd2e61f commit e6db7b3Copy full SHA for e6db7b3
udapi/block/read/addbratann.py
@@ -77,9 +77,12 @@ def process_document(self, document):
77
except Exception as e:
78
logging.warning(f"Unexpected mention line: {line}\n{e}")
79
elif line.startswith(self.coref_attr):
80
- cor_attr, mention_ids = line.split("\t")
81
- parts = mention_ids.split()
82
- assert(parts[0] == "Coreference")
+ try:
+ cor_attr, mention_ids = line.rstrip().split("\t")
+ parts = mention_ids.split()
83
+ assert(parts[0] == "Coreference")
84
+ except Exception as e:
85
+ logging.warning(f"Unexpected coref line: '{line}'\n{e}")
86
clusters.append([p.split(":")[1] for p in parts[1:]])
87
elif line.startswith("#"):
88
pass # Let's ignore annotators' comments
0 commit comments