An official website of the United States government
Here’s how you know
Official websites use .gov A
.gov website belongs to an official government
organization in the United States.
Secure .gov websites use HTTPS A
lock (
) or https:// means you’ve safely connected to
the .gov website. Share sensitive information only on official,
secure websites.
CSpell
Dictionary-based Correction - Design
This page describes the high level design for dictionary-based corrections of spelling errors.
if legit: go to the detection process as described bellows.
if not legit: go to the next token (no change on current token)
space token: no need to correct a space.
token is too long: when a token is too long (has too many characters) and is not in the dictionary (non-word), it could generate too many candidates for corrections. This process might cause slow speed performance and even use up all memory. Thus, the maximum length of a legit token (CS_MAX_LEGIT_TOKEN_LENGTH) should be specified in the configuration file, default value is set as 30. Also, there is a little chance to correctly correct such tokens.
Accordingly, any token is longer than the specified value are not a legit token and will not be corrected.
Tokenize: Get CoreTerm from the input word (inToken)
Detection: detect if the focused token (coreTerm) matches the correction criteria,