You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kdruzhkin@Rhodos:~$ ipython
In [1]: import opencorpora
In [2]: corpus = opencorpora.CorpusReader('annot.opcorpora.xml')
In [3]: tws = corpus.iter_tagged_words()
In [4]: for tw in tws: pass
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-6-58b1ffe6da49> in <module>()
----> 1 for tw in x: pass
/usr/local/lib/python3.4/dist-packages/opencorpora/reader.py in _doc_iterator(self, fileids, categories, doc_method)
214 for doc in self.iter_documents(fileids, categories, _destroy=True):
215 meth = getattr(doc, doc_method)
--> 216 for res in meth():
217 yield res
218
/usr/local/lib/python3.4/dist-packages/opencorpora/reader.py in iter_tagged_words(self)
110
111 def iter_tagged_words(self):
--> 112 return itertools.chain(*self.iter_tagged_sents())
113
114 def iter_parsed_words(self):
/usr/local/lib/python3.4/dist-packages/opencorpora/reader.py in _sentence_tagged_words(sent_elem)
37 text = text_type(tok.get('text'))
38 parse = tok.find('*//l')
---> 39 tag = text_type(',').join(_grammemes(parse))
40 res.append((text, tag))
41 return res
/usr/local/lib/python3.4/dist-packages/opencorpora/reader.py in _grammemes(l_element)
55 def _grammemes(l_element):
56 return [text_type(grammeme.get('v'))
---> 57 for grammeme in l_element.getchildren()]
58
59
AttributeError: 'NoneType' object has no attribute 'getchildren'
The text was updated successfully, but these errors were encountered:
Из pymorphy2/pymorphy2#48:
The text was updated successfully, but these errors were encountered: