Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spell doesn't load in Windows #4

Open
negm opened this issue Feb 25, 2016 · 5 comments
Open

Spell doesn't load in Windows #4

negm opened this issue Feb 25, 2016 · 5 comments

Comments

@negm
Copy link
Contributor

negm commented Feb 25, 2016

I traced the issue to utils.py -> with closing(t.extractfile(tar_path)) as f:
it seems the tarfile library doesn't behave as intended on Windows. I extracted the file manually and changed the code to open it using os.open for now but I intended to make a pull request with a more general solution soon
Thanks for your effort

@foobarmus
Copy link
Member

Hey, thanks for yours!

I didn't have access to a windows system when I was building that, so I'm
not surprised about the issue. Happy to incorporate your improvements if
they're neat and tidy

Cheers

Jonas

On 25 February 2016 at 06:30, negm [email protected] wrote:

I traced the issue to utils.py -> with closing(t.extractfile(tar_path)) as
f:
it seems the tarfile library doesn't behave as intended on Windows. I
extracted the file manually and changed the code to open it using os.open
for now but I intended to make a pull request with a more general solution
soon
Thanks for your effort


Reply to this email directly or view it on GitHub
#4.

@cedricdonie
Copy link

I have changed the source code to work on windows. Because tar can be a little bit finicky, I switched to an LZMA zip file instead of the bzipped one and just used the standard ZipFile module. An advantage to this is that the file takes a little less space and is more cross-platform. I'll make a pull request for the updated version, but if you want to keep yours the way it is I can make a windows fork.

@cedricdonie
Copy link

Ok, cant' figure out the pull requests, but here's my code: Gist
words.zip
This is the LZMA zip file.

@InTheZ
Copy link

InTheZ commented May 29, 2016

Hi, I submitted a pull request to fix this issue. I found that a LZMA formatted file doesn't seem to work in a default install of windows.

@Odianosen25
Copy link

Odianosen25 commented Oct 8, 2017

@foobarmus many thanks for your work on this, but I kindly have a few questions:

  1. It installs and functions fine on my RPi, but on my Windows, I get this error Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> from autocorrect import spell File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\autocorrect\__init__.py", line 16, in <module> from autocorrect.nlp_parser import NLP_COUNTS File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\autocorrect\nlp_parser.py", line 26, in <module> NLP_WORDS, NLP_COUNTS = parse('big.txt') File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\site-packages\autocorrect\nlp_parser.py", line 20, in parse words = words_from_archive(lang_sample, include_dups=True) TypeError: words_from_archive() got an unexpected keyword argument 'include_dups'

Please any help will be greatly appreciated on how to solve this.

  1. If I want to be able to update the words used in the module, which of the text file please should I input my words?

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants