ci_edit icon indicating copy to clipboard operation
ci_edit copied to clipboard

Spelling dictionaries (was Grammar checking)

Open aaxu opened this issue 7 years ago • 12 comments

image 'URIs' is half highlighted.. and cucumber isn't a real word? :( RIP. And then there are other words too.

aaxu avatar Oct 11 '17 18:10 aaxu

Also, what do you think making the incorrect words a darker red with a white background or something. I find that the bright red background sometimes hurts my eyes and I also sometimes lose track of the cursor when it hovers over an incorrect word because the cursor goes from blinking black and white to white and red.

aaxu avatar Oct 11 '17 18:10 aaxu

Background I'd made a separate spelling dictionary so the license would be the same and it would be included with the editor. So I didn't yet notice that cucumber was not in the dictionary :) If ya look through the git log, you'll see occasional patches with "dictionary words" where I'm adding dictionary words. I added more just this morning. Please consider adding cucumber and others to the app/dictionary.en-us.words file. (or I will, but I thought if we both started doing it we'd have more words quicker)

dschuyler avatar Oct 11 '17 18:10 dschuyler

The URIs highlighting is a separate bug. I should fix that. Consider making a separate New Issue.

The highlight is also something for a separate New Issue. We can change the color or add a new style option. Would you like to consider making a style that we include as an option (like all the colors could change to your liking).

dschuyler avatar Oct 11 '17 18:10 dschuyler

How did you start writing the file for the dictionaries? You add each word manually right LOL Could we not just find a text file containing all dictionary words and add them the file?

aaxu avatar Oct 11 '17 18:10 aaxu

Created issue for half highlighted word in #90

aaxu avatar Oct 11 '17 18:10 aaxu

I remember trying to figure out the entire color scheme a while ago, but couldn't figure it out completely. I think the most confusing thing was the list of palette values in default_prefs.py and this line in ci_program.py

for i in range(1, curses.COLORS):
        curses.init_pair(i, foreground[i % cycle], background[i / cycle])

made me confused since I couldn't see a particular pattern or reason for this implementation. Maybe I'll give this another tackle in a bit (midterms coming up :( ), since I also need to fix #42

aaxu avatar Oct 11 '17 18:10 aaxu

Could we not just find a text file containing all dictionary words and add them the file?

We must not use someone else's copyrighted material.

dschuyler avatar Oct 13 '17 02:10 dschuyler

I also need to fix #42

I'll start on some 8 color support to help on that.

dschuyler avatar Oct 13 '17 02:10 dschuyler

...confused since I couldn't see a particular pattern or reason for this implementation.

Good feedback, thanks! I'll work on making that clearer.

dschuyler avatar Oct 13 '17 02:10 dschuyler

How does the file look with the latest ci_edit? I've added more dictionary words.

dschuyler avatar Oct 17 '17 02:10 dschuyler

It looks better. 'runtimes' isn't recognized as a word ("runtime" is). I opened up a text file of Pride and Prejudice and found a lot of words that show up as red. What if we made a program that could parse through books and auto update our list with the new words? :D code that writes code. Then we could just parse through like 1000 books and push to master??!

aaxu avatar Oct 17 '17 03:10 aaxu

Here's some progress: I added support for huge dictionaries with OsDictionary in ci_edit/app/spelling.py.

On startup it will now try to open /usr/share/dict/words as a fallback dictionary. Though there are still words in PAndP that are not covered, Jane has a larger vocabulary than a multi-megabyte list of words covers (and there's the British spellings in there too).

dschuyler avatar Oct 21 '17 02:10 dschuyler