From 36d4a217f737d022f61399ae6ef1789e953fced3 Mon Sep 17 00:00:00 2001 From: Ozbolt Menegatti Date: Tue, 8 Jan 2019 19:37:28 +0100 Subject: [PATCH] Catching modra links from root --- wani.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wani.py b/wani.py index 850d1c1..a622d3c 100644 --- a/wani.py +++ b/wani.py @@ -384,11 +384,19 @@ def load_corpus(filename): lfrom = l.get('from') if lfrom in words: + assert(not lfrom.endswith('.0')) next_word_id = l.get('dep') if next_word_id in words: next_word = words[next_word_id] words[l.get('from')].add_link(l.get('afun'), next_word) + # catch modra links from root + elif lfrom[-1] == '0' and l.get('afun') == 'modra': + root_words.add(l.get('dep')) + pass + else: + # strange errors, just skip... + pass return list(words.values())