Re: [racket-dev] Implementing a spell checker in DrRacket

121 views
Skip to first unread message
Message has been deleted

Leif Andersen

unread,
Dec 5, 2016, 4:12:44 PM12/5/16
to jer...@g.clemson.edu, Racket Developers
Fun fact, DrRacket already has a spell checker. It's not the best thing ever, and it also requires you to have a/ispell (or whatever it is) installed, but it gets the job done for some use cases.

You can get it by going to:

Edit -> Spell check string constants
Edit -> Spell check text (between {} in scribble)

You can tell it's working because if you have a word misspelled in a drracket string, it will be black instead of green.

Enjoy.




~Leif Andersen

On Mon, Dec 5, 2016 at 4:08 PM, <jer...@g.clemson.edu> wrote:
Hi Racketeers,

I'm planning to implement a spell checker in DrRacket.  I have two main concerns I'd like to raise with you all before I get in too deep:
  • Is there anyone else currently working on this?
  • I need help understanding what legal and licensing issues there are by using the ispell ( https://lasr.cs.ucla.edu/geoff/ispell.html ) source code as a reference.  I use the word "port" in parenthetically below because I'm using details learned from the C source to implement the Racket code.   Maybe its a matter of asking the maintainer of ispell what to do? I don't know.

The idea came from the wiki,

Write a parser for ispell dictionaries. Make DrRacket use it.

I've made enough progress writing the ispell dictionary parser that I feel confident this is a project I can complete with a little help from the community.

Here is a 50,000 foot outline of the work I have planned:
  1. Finish writing (porting) the ispell dictionary hash parser
  2. Write (port) the spelling corrector engine
  3. Solicit feedback from the Racket community regarding DrRacket feature details like the following,
    1. How should a misspelled word look in DrRacket? 
    2. How does the user want to control the spell checker?  
    3. Should it check word in function names, or just inside strings or scribble text blocks? 
    4. etc.
  4. Implement the DrRacket integration using feedback from (3).
  5. Put up a PR!
Thanks,
Jerry



--
You received this message because you are subscribed to the Google Groups "Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+unsubscribe@googlegroups.com.
To post to this group, send email to racke...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/edffbcdf-d311-4bc2-b24f-62e6e9dba435%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jer...@g.clemson.edu

unread,
Dec 5, 2016, 4:33:45 PM12/5/16
to Racket Developers, jer...@g.clemson.edu
Leif, Wow, I'm not sure how I missed that it already has the feature :/. Thanks!


~Leif Andersen

To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+...@googlegroups.com.

Robby Findler

unread,
Dec 5, 2016, 4:46:30 PM12/5/16
to Racket Developers, jer...@g.clemson.edu
You are welcome to try it out and improve it! It is pretty bare bones.

Robby

Jens Axel Søgaard

unread,
Dec 5, 2016, 6:06:20 PM12/5/16
to Leif Andersen, jer...@g.clemson.edu, Racket Developers


> Den 5. dec. 2016 kl. 22.12 skrev Leif Andersen <le...@leifandersen.net>:
>
> Fun fact, DrRacket already has a spell checker.

Does it call ispell or simply use the dictionaries?

/Jens Axel

Robby Findler

unread,
Dec 5, 2016, 6:12:12 PM12/5/16
to Jens Axel Søgaard, Leif Andersen, Racket Developers, jer...@g.clemson.edu
It uses aspell.

Robby

--
You received this message because you are subscribed to the Google Groups "Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+...@googlegroups.com.

To post to this group, send email to racke...@googlegroups.com.

Jens Axel Søgaard

unread,
Dec 5, 2016, 6:34:47 PM12/5/16
to Robby Findler, Leif Andersen, Racket Developers, jer...@g.clemson.edu
Ok - so a Racket implementation would be a Good Thing (TM). 

jer...@g.clemson.edu

unread,
Dec 6, 2016, 11:33:19 AM12/6/16
to Racket Developers, ro...@eecs.northwestern.edu, le...@leifandersen.net, jer...@g.clemson.edu
Ah, I see now, DrRacket currently calls out to the i/aspell binary on the user's path, I thought it was bundled up somehow.  I tested DrRacket's spell check on my fedora system yesterday when I saw Leif's response, and it just worked because ispell was setup correctly.  Later I tried it on my mac and it failed, then I realized I misunderstood what the situation is.

Ok! I'll keep working on the native implementation in that case.

RE: Licensing issues that may be caused by porting from the C source; I guess for now i'll just keep a bibliography of sorts that provides tracability from the Racket source to the C source; later, I can figure out how to properly give credit to the appropriate people.  Does this sound OK? 

Leif Andersen

unread,
Dec 6, 2016, 11:37:07 AM12/6/16
to jer...@g.clemson.edu, Racket Developers, Robby Findler
Oh ya, if you are making a racket version that would absolutely be a good thing.

Especially because, from my experience, getting the spell checker to work on windows is a bit of a nightmare.


~Leif Andersen
Reply all
Reply to author
Forward
0 new messages