ufal / morphodita

MorphoDiTa: Morphologic Dictionary and Tagger
Mozilla Public License 2.0
69 stars 7 forks source link

Using morphodita with nametag raises exception #7

Closed Mimino666 closed 8 years ago

Mimino666 commented 8 years ago

I tried to to use both morphodita and nametag at the same time, but a strange exception is raised, when I import nametag into the project:

from ufal.morphodita import Tagger, Forms, TokenRanges
import ufal.nametag  # this line causes the problem

forms = Forms()
tokens = TokenRanges()
tagger = Tagger.load(path_to_model)
tokenizer = tagger.newTokenizer()
tokenizer.setText(text)
while tokenizer.nextSentence(forms, tokens):
    pass

Result:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: in method 'Tokenizer_nextSentence', argument 2 of type 'std::vector< std::string,std::allocator< std::string > > *'

If I switch the order of the imports, the exception is not raised in the above example, but if I try to use nametag a different exception is raised.

foxik commented 8 years ago

Confirmed.

Will look into it sometimes during the week.

foxik commented 8 years ago

The problem was caused by the way how NameTag was using MorphoDiTa.

I released new NameTag version (1.1.1) and new CPAN and PyPI packages.

I am closing the issue now, if it still persists (which it should not), please reopen it.

Mimino666 commented 8 years ago

Looks okay. Thank you for a quick fix :)