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())