1. Overview

Autocorrect as you type functionality (beta) was released on Friday 13 Aug as a part of the WebSpellChecker v5.15.0 release.  Autocorrect automatically makes or suggests corrections for common spelling mistakes while users are typing.

It is a new feature enabled for:

  • WProofreader core (e.g. WProofreader add-on for RTEs, plugin for WordPress, plugin for CKEditor 5, browser extension);
  • API.

Autocorrect is enabled by default using the new WProofreader API option autocorrect.

The feature is available for all languages where spelling is supported (excluding Japanese and Chinese).

For the 25 most popular languages that are enabled by default for the on-premise version (excluding Swiss German - de_CH), autocorrect is based on the replaced_data statistics that were extracted from our databaseDB to the *.cvs files with word pairs that will be used initially for autocorrect. The same files are for the Cloud and Server versions. Autocorrect for other languages generates suggestions purely from spell-check dictionaries.

While the Server client can configure what languages should have autocorrect enabled using AppServerX.xml using the <Autocorrect Enabled> tag.

There is a known issue with how the autocorrect functionality works in the Firefox and CKEditor 5 bundle. It's limited to some cases where a misspelt word is followed by a comma or other punctuation symbol (while it is supposed to work with 'space'). Due to certain specifics of CKEditor 5, we are not able to fix that right away but it is in our plans.

At the moment, Autocorrect doesn't work in Google Docs.

2. The autocorrect mechanism

The trigger action that starts autocorrection - the user types a word and presses space key or comma. 

Algorithm behind autocorrect is relying on a similarity score (Levenshtein distance). If the condition is not met, we return an empty response -> no autoreplace. 

Also, there is an additional check for the languages that use replaced_data statistics file, the algorithm will check if the word for replace is present in one of the available dictionaries: language dictionary, user or company custom dictionary. If a word is not present in the dictionary, we will not use the word from the autocorrect file.

In case of auto detected language, autocorrect uses the last detected language as a language for autocorrect check.

The user can undo the correction using the Revert option. For now Revert isn't localized and valid only for the current section.

Some clients may want to have their own lists for autocorrection. This option is available for the Server clients only (the details are below in the article), Cloud customers may report the most common corrections and we will add them manually.

3. How the autocorrect works

The user is typing text and Autocorrect automatically makes or suggests corrections for common spelling mistakes like hte-the, havent-haven’t, isnt-isn’t

The autocorrected word will be underlined with a gray dotted line. End users have an option to revert/undo the correction by hovering on it and selecting the original word.

Also, users can enable/disable Autocorrect in the Settings dialog of the product with a toggle “Correct spelling automatically”

Check how it works in the video below or play with demos here.

4. How to configure Autocorrect

Admins can disable autocorrect by default by adding autocorrect option set to false to WEBSPELLCHECKER_CONFIG. In this case end users still will have an option to enable autocorrect from UI of the Settings dialog.

<script>
window.WEBSPELLCHECKER_CONFIG = {
	...
    autocorrect: false,
	...
}
</script>

This option as well as all other options for WProofreader are available in the WProofreader API options.

5. Instructions for managing autocorrect word pairs for Server customers

To manage the list of current word pairs for Autocorrect or add new pairs, please follow the steps below:

1. Stop the WebSpellChecker AppServer.

2. Navigate to the WebSpellChecker_Installation_Path\AppServer\LanguageDictionaries\language_shortcode directory.

Starting WebSpellChecker version 5.29.2.0 the path to the autocorrect folders with the appropriate files was changed to the following: WebSpellChecker_Installation_Path\AppServer\Resources.

3. Locate and open the "language_shortcode_autocorrect.csv" file.

4. Make the desired changes to the file.

There are specific criteria governing the word pairs eligible for Autocorrect. The initial word added should not exist in the dictionaries, enabling our proofreader to identify it as a misspelling. Conversely, the replacement word must be present in one of the dictionaries: default language dictionary, user or company custom dictionary. Our Autocorrect mechanism strictly suggests valid words as corrections. Also, make sure that the following is true:

  • Check that misspelling and correction are words (not phrases and e.t.c.);
  • Check that misspelling are lowercase (to exclude names, e.t.c.) (For German we allow first capital letter only);
  • Check that misspelling do not have numbers or dots;
  • Check that size of misspelling word >= 3.

5. Save the modified file.

6. Restart the WebSpellChecker AppServer to apply the changes.

By following these instructions, you will be able to effectively manage and update the Autocorrect word pairs in the designated file. If you encounter any issues or require further assistance, please don't hesitate to contact our support team at [email protected].

The automated WebSpellChecker upgrade system will utilize the autocorrect wordlists of the most recently installed version, disregarding any manual changes made on your end. Consequently, to preserve your customized Autocorrect words pairs, it will be necessary to transfer them manually after the software upgrade. Therefore, we recommend carefully noting down your customizations before the upgrade and taking the necessary steps to reintegrate them afterward.