Comments (10)
Seems to work okay for me. What is the contents of your ~/.scspell/dictionary.txt
?
from scspell.
Looks like some default dictionary:
$ cat .scspell/dictionary.txt
FILETYPE: C/C++; .h, .hh, .hpp, .hxx, .c, .cc, .cpp, .cxx
acos
ansi
...
wostream
wprintf
wscanf
from scspell.
Is there a line NATURAL:
in there? If not, that might explain the problem.
For example, I can reproduce the problem if I remove NATURAL:
from my dictionary.txt
.
from scspell.
Nope, content of that file had just one header (FILETYPE) and all terms related to programming:
k4rtik at PlatiniumAir in ~
$ cat .scspell/dictionary.txt | grep NATURAL
k4rtik at PlatiniumAir in ~
Do I need to include some natural language dictionary myself? Or did scspell fail to automatically find any on my OS X 10.10.3 system and hence it is missing in this file?
from scspell.
Remove the ~/.scspell
directory and run scspell
again against any file. It should detect that the directory is missing and recreate a correct dictionary file for you.
If the above doesn't work, then maybe your installation of scspell
is corrupted. In that case, reinstall scspell
and do the above again.
from scspell.
$ scspell tp-dialog.rkt
Warning: unable to read dictionary file "/Users/k4rtik/.scspell/dictionary.txt". (Reason: [Errno 2] No such file or directory: '/Users/k4rtik/.scspell/dictionary.txt')
Continuing with empty dictionary.
tp-dialog.rkt:1: Unmatched 'lang' --> {lang}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
tp-dialog.rkt:1: Unmatched 'racket' --> {racket}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
Subtoken 'racket':
(b)ack, (i)gnore, add to (p)rogramming language dictionary, or add to
(n)atural language dictionary? [i]
Extension ".rkt" is not registered. With which programming language
should ".rkt" be associated?
0: (Create new language file-type)
Enter number of desired file-type: Racket
Enter number of desired file-type: 0
Enter a descriptive name for the programming language: Racket
tp-dialog.rkt:1: Unmatched 'base' --> {base}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
1: #lang racket/base
2: (require racket/gui/base
3: racket/class
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
tp-dialog.rkt:2: Unmatched 'require' --> {require}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
tp-dialog.rkt:3: Unmatched 'class' --> {class}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
User abort.
Warning: unable to write dictionary file "/Users/k4rtik/.scspell/dictionary.txt". (Reason: [Errno 2] No such file or directory: '/Users/k4rtik/.scspell/dictionary.txt')
Without dictionary file, all words started getting flagged. Ctrl-C interrupt resulted in [Errno 2] as shown.
I will try reinstalling.
from scspell.
Post-reinstall log:
- Dictionary was restored, had C/C++, Python and Natural language words.
- I could run scspell on tp-dialog.rkt correctly
- I added a word to a new programming dictionary "Racket", few more additions.
- Continue spellcheck, program crashed.
- dictionary.txt now had just the C/C++ words, rest of the file was gone.
I think it's a bug somewhere in writing to the dictionary file (after adding a new language). Trimmed shell log follows:
$ scspell tp-dialog.rkt
tp-dialog.rkt:9: Unmatched 'getinfo' --> {getinfo}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
[...]
tp-dialog.rkt:17: Unmatched 'htdp' --> {htdp}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
Subtoken 'htdp':
(b)ack, (i)gnore, add to (p)rogramming language dictionary, or add to
(n)atural language dictionary? [i]
Extension ".rkt" is not registered. With which programming language
should ".rkt" be associated?
0: C/C++
1: Python
2: (Create new language file-type)
Enter number of desired file-type: 2
Enter a descriptive name for the programming language: Racket
tp-dialog.rkt:19: Unmatched 'teachpack' --> {teachpack}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
Subtoken 'teachpack':
(b)ack, (i)gnore, add to (p)rogramming language dictionary, or add to
(n)atural language dictionary? [i]
tp-dialog.rkt:21: Unmatched 'teachpacks' --> {teachpacks}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
Subtoken 'teachpacks':
(b)ack, (i)gnore, add to (p)rogramming language dictionary, or add to
(n)atural language dictionary? [i]
tp-dialog.rkt:25: Unmatched 'syms' --> {syms}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
[...]
tp-dialog.rkt:88: Unmatched 'dclick' --> {dclick}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
86: (λ (this evt)
87: (case (send evt get-event-type)
88: [(list-box-dclick)
89: (update-button-and-conflict)
90: (selected this)]
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
tp-dialog.rkt:179: Unmatched 'parameterize' --> {parameterize}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
Subtoken 'parameterize':
(b)ack, (i)gnore, add to (p)rogramming language dictionary, or add to
(n)atural language dictionary? [i]
[...]
tp-dialog.rkt:412: Unmatched 'rackunit' --> {rackunit}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
tp-dialog.rkt:415: Unmatched 'lkup' --> {lkup}
(i)gnore, (I)gnore all, (r)eplace, (R)eplace all, (a)dd to dictionary, or
show (c)ontext? [i]
Traceback (most recent call last):
File "/usr/local/bin/scspell", line 85, in <module>
scspell.spell_check(files, opts.override_filename, opts.report)
File "/usr/local/lib/python2.7/site-packages/scspell/__init__.py", line 621, in spell_check
spell_check_file(f, dicts, ignores, report_only)
File "/usr/local/lib/python2.7/site-packages/scspell/_corpus.py", line 511, in __exit__
self.close()
File "/usr/local/lib/python2.7/site-packages/scspell/_corpus.py", line 356, in close
corpus.write(f)
File "/usr/local/lib/python2.7/site-packages/scspell/_corpus.py", line 143, in write
f.write('\n')
TypeError: must be unicode, not str
from scspell.
I see. This is a Python 2 related issue, which would explain why I never saw this on my installation. Thanks for the stack trace.
from scspell.
It should be fixed now. Install the latest version and then remove the ~/.scspell
and run scspell
once again.
from scspell.
Great, no crash now. Thanks for the quick fix. 😄
from scspell.
Related Issues (19)
- Errors on Windows
- Do not control files names HOT 5
- Add to dictionary from command line HOT 2
- scspell should support directory traversal HOT 2
- scspell does not match backslashed words
- option to report list of unique misspellings
- python2 set-dictionary issue HOT 2
- Create a dictionary from a directory
- API for getting all of the spelling corrections
- Wrong FSF address in license
- scspell splits words tokens with diacritics inside words HOT 1
- Suggestion: show edit distance to closest correct word
- Include tests in source tarball HOT 1
- Change default tokenizers
- Add pre-commit support
- Allow disabling/ignoring some lines using a disable-scspell comment
- Allow directory walking
- Warning during pip installation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scspell.