Catching modra links from root
This commit is contained in:
parent
06d4217b0b
commit
36d4a217f7
8
wani.py
8
wani.py
|
@ -384,11 +384,19 @@ def load_corpus(filename):
|
||||||
|
|
||||||
lfrom = l.get('from')
|
lfrom = l.get('from')
|
||||||
if lfrom in words:
|
if lfrom in words:
|
||||||
|
assert(not lfrom.endswith('.0'))
|
||||||
next_word_id = l.get('dep')
|
next_word_id = l.get('dep')
|
||||||
if next_word_id in words:
|
if next_word_id in words:
|
||||||
next_word = words[next_word_id]
|
next_word = words[next_word_id]
|
||||||
words[l.get('from')].add_link(l.get('afun'), next_word)
|
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())
|
return list(words.values())
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user