aboSamoor / polyglot

Multilingual text (NLP) processing toolkit
http://polyglot-nlp.com
Other
2.3k stars 337 forks source link

Resolved some Windows specific issues #131

Closed janissl closed 6 years ago

janissl commented 6 years ago

Hello,

I made some fixes that resolve issues for Windows users.

On Windows, os.path.sep is '\\' instead of '/' that caused Index out of range errors while using polyglot downloader. So I changed os.path.sep to a hard-coded string here as it does not change between any OS.

Windows also does not have SIGPIPE. So I changed it to SIGABR that seems functionally the closest one to SIGPIPE.

I have tested my fixes on two 64-bit Windows 10 machines with Python 3.6 installed and was finally able to download morph2 files as well as use other options of downloader. No Python version-specific changes were implemented. For non-Windows machines, the code stays the same.

Best regards, Janis