From 94d5a6cd734652a596a01413705ede7cf03fb30a Mon Sep 17 00:00:00 2001 From: voje Date: Sun, 21 Apr 2019 16:07:08 +0200 Subject: [PATCH] added exception to parsing ssj --- corpusparser/Parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/corpusparser/Parser.py b/corpusparser/Parser.py index d135256..7a5f38a 100644 --- a/corpusparser/Parser.py +++ b/corpusparser/Parser.py @@ -61,7 +61,10 @@ class Parser(): def parse_any_links_ssj(self, sent_el, links_type): lgrps = sent_el.findall(".//linkGrp") - links = [x for x in lgrps if x.get("type") == links_type][0] + try: + links = [x for x in lgrps if x.get("type") == links_type][0] + except: + return [] res_links = [] for link in links: tar = self.parse_ssj_target_arg(link.get("target"))