Is there an example autocorrect (not autocomplete) package?


#1

As I mentioned before, I writing tools to help me write novels on Atom. One of the more useful ones I’d like to see while writing is autocorrect (as opposed to autocomplete). I haven’t found a good example in the APM repository that actually implements this. Is it possible in Atom?

I found @davidfig’s https://github.com/davidfig/atom-autocorrect-text but it doesn’t seem to have a package associated with it. I’m looking for the same basic things as that package is trying to do (handle the “DOuble” case letters), common typos (“teh” instead of “the”), and spacing sequencing (“fa tchance”).

As my spell-check work suggests, I’m actually looking to make something pluggable so I can have something that handles common character name misspellings (Dlyan -> Dylan) for a given author/novel and to handle those pesky accented characters sci-fi/fantasy authors seem to be fond of (“Rute” -> “Rutejìmo”). I don’t want it universal, which is why a plugin seems appropriate.

Thank you.


Typo auto replace
#2

There isn’t an autocorrect API specifically built-in to Atom, but it shouldn’t be hard to create one based on TextEditor.onDidChange or TextEditor.onDidStopChanging based on how immediately you wanted to do autocorrections. If you chose to use onDidChange though, you would want to ensure that as much as possible the work is done asynchronously or even out-of-process to prevent bogging down the typing experience.


#3

Yeah, one of the requirements is that it has to keep up at 120 wpm. :slight_smile:

Cool, that will give me an idea some more ideas of where to look.


#4

I would be definitively interested to test this feature, as I write novels too with atom, in markdown, and I need to have French typos autochanges.


#5

I’m finishing up the spell checker patch that I started. I suspect auto correct will be the next one on my plate. Mainly, I want to make it pluggable (like my spell check work) so we can have a dictionary-based auto correct or simple substitutions or something more complicated like my Author Intrusion project.


#6

It’s rather rough and limited, but I was seeing a bunch of typos while writing this novel, so I spent a few days banging up an autocorrect plugin for Atom. Just install autocorrect and autocorrect-en (because I like plugins), open up a text or Markdown file and type Teh CHeese is awesome. Right now, it only converts Teh into The, teh into the, and double capital words DOuble into single capital.

I hung it off onDidStopChanging, so there is a 300 ms delay before it actually does the correction, but it keeps the cursor in place and handles my typing rate pretty well.