quickscript icon indicating copy to clipboard operation
quickscript copied to clipboard

[Project idea] Idea for new QuickScript - Add new words to aspell dictionary

Open soegaard opened this issue 3 years ago • 5 comments

Maybe a QuickScript could be used to add new words to a personal aspell dictionary?

https://github.com/racket/drracket/issues/253

soegaard avatar Jan 23 '22 13:01 soegaard

That should be relatively easy to do indeed, since it's just a matter of adding a word at the end of a file, as per the given link. I guess this tells us where the dictionary lives.

The simplest coder-side way to do it is to require that the user selects the word to add before invoking the quickscript, so as to obtain it via the str input argument of the script. The most user-friendly is to look for the word, using move-position on the current editor, by adding the keyword argument #:editor ed to the arguments of the scripts (see here). Hyphens, underscores and such can make the matter tricky though, and may need validation by the user.

Metaxal avatar Jan 24 '22 11:01 Metaxal

I think aspell works with both a standard dictionary as well a personal dictionary. Invoking aspell with the right argument will reveal where the personal dictionary is [1]. I think it is okay just to append to the file, but aspell probably a command for adding words too.

[1] https://unix.stackexchange.com/questions/116283/how-can-i-export-my-aspell-dictionary

soegaard avatar Jan 24 '22 18:01 soegaard

Works with me too. It's just that I prefer to avoid system calls whenever possible (in particular for portability reasons), but otherwise I don't mind that much.

Metaxal avatar Jan 25 '22 15:01 Metaxal

It may be worth refactoring the code that manages the aspell connection in the framework to make it accessible to quickscripts.

Robby

rfindler avatar Jan 25 '22 15:01 rfindler

My idea was that a "add word to dictionary" QuickScript would be a nice project for someone new to Racket or QuickScript. I think refactoring the framework is a different class of project :-)

/Jens Axel

soegaard avatar Jan 26 '22 17:01 soegaard