python-crfsuite icon indicating copy to clipboard operation
python-crfsuite copied to clipboard

Fail to open .crf file with path containing utf-8 characters such as 'ö'

Open Bringers opened this issue 5 months ago • 0 comments

I am using this in a project on a Swedish windows computer. For some reason windows names the admin user folder to "Administratör" (swedish for "Administrator"). I would love to rename this folder but since it is the highest admin on this PC it is tricky to rename (I have tried).

Trying to use "TTS" text to speach and they use your tagger. There I get the following issue at

File "pycrfsuite/_pycrfsuite.pyx", line 572, in pycrfsuite._pycrfsuite.Tagger.open
UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 20: ordinal not in range(128)

The line calling this looks like this

self.crf_tagger.open(str(crf_tagger))

where str(crf_tagger) evaluates to something like "C:\Users\Administratör....."

Could someone fix this? I am not confident enough to make a PR on my own here. I am guessing that you need to introduce utf-8 support in this project somewhere. (or make it possible to configure)

Bringers avatar Jan 13 '24 16:01 Bringers