AI Glossary / Natural language and speech / Beginner

Spell checker

Definition

A spell checker is a tool that detects possible spelling errors and may suggest corrections. It compares written forms with lexical resources, language patterns, or both. A suggestion is a candidate for the intended wording, not proof that the writer meant it or that the surrounding sentence is correct.

What it means

Some errors produce an unrecognized string, such as a missing letter in a familiar word. Others produce a correctly spelled but unintended word, such as “form” where “from” was intended. A dictionary-only checker can flag many errors of the first kind while missing the second.

Names, specialist vocabulary, regional spellings, and newly coined words complicate the task. An unfamiliar word is not necessarily wrong. A useful checker distinguishes uncertainty from certainty and allows the writer to retain a valid term rather than forcing a common replacement.

How it works

A basic checker divides text into tokens, applies relevant normalization, and checks candidate words against a lexicon. Morphological rules can recognize permitted inflections or combinations without listing every possible form separately. Hunspell is an established implementation that supports dictionary and affix-based checking.

For a suspected error, a correction system generates alternatives and ranks them. Possible edits include inserting, deleting, substituting, or transposing letters. A statistical method can combine how plausible a candidate word is with how likely the observed error would be if that candidate were intended.

Contextual systems also examine neighboring words or sentences. Finally, the interface presents suggestions or applies an authorized correction policy. Detection, suggestion ranking, and automatic replacement are separate stages with different failure consequences.

Three practical examples

1. A document editor flags an unfamiliar product name. The writer verifies it and adds it to a controlled custom dictionary instead of accepting a misleading common-word replacement.

2. A search box offers a possible correction for a mistyped query while preserving access to the original query. This helps when a rare term is intentional.

3. A publishing team checks regional spelling conventions across a manuscript. The chosen language setting affects accepted variants, so consistency checking should follow the publication's stated style.

Think of it this way

Think of a careful proofreader placing a question mark beside suspicious words and listing plausible alternatives. The mark invites a decision; it is not a verdict on the writer's intent. The analogy is limited because a spell checker may have little domain knowledge and can systematically prefer frequent words over the correct specialist term.

Worked example

Consider the invented input “plam,” which a toy checker does not recognize. Its candidate generator finds “plan” by replacing m with n and “palm” by swapping the adjacent letters l and a. Both candidates are one edit away under a model that counts substitution and adjacent transposition as single edits.

Suppose the toy language model assigns prior values P(plan)=0.006 and P(palm)=0.001. Suppose the error model assigns P(plam given plan)=0.01 and P(plam given palm)=0.10. The combined scores are 0.006 times 0.01=0.00006 for plan and 0.001 times 0.10=0.00010 for palm.

Under these stated values, palm wins despite having a lower word prior. The stronger error-model score outweighs that difference. If these were the only two candidates and their scores were normalized, palm would receive 0.00010/0.00016=0.625, or 62.5% of the two-candidate mass.

The values are invented and do not establish a calibrated real-world confidence. A sentence about scheduling could change the ranking in a contextual model. The exercise illustrates candidate generation and ranking, not a tested correction engine or a universal preference for transpositions.

Illustrative case study

Illustrative fictional case: Greenline Manuals adds a spell checker to its editing workflow. The tool repeatedly flags a valid component name and suggests a common word. One editor accepts the suggestion, changing a technical instruction's reference.

The team creates a reviewed domain dictionary and keeps uncertain replacements visible. It also tests sentences containing real-word errors, which its original dictionary checks often overlook. This fictional scenario shows how workflow and vocabulary affect reliability; it reports no actual error-rate reduction.

Common misconceptions and mistakes

A word absent from the dictionary is not automatically misspelled. The dictionary may be incomplete, configured for another language, or missing names and technical vocabulary.

A correctly spelled word can still be wrong in context. Spell checking alone does not establish grammatical or factual correctness.

The nearest candidate by edit distance is not always the intended word. Frequency, keyboard errors, pronunciation, and context can change the best ranking.

Automatic replacement is riskier than a suggestion because it changes the text. A system should not silently convert every unfamiliar term into a familiar one and treat the result as verified.

Business use

Businesses use spell checkers in writing tools, search interfaces, forms, and content production. Select the language and regional conventions, maintain specialist dictionaries where needed, and distinguish detection from automatic editing. Test names, abbreviations, mixed-language text, and terms whose spelling affects meaning.

Measure both missed errors and false alarms. Frequent false alarms can encourage users to ignore warnings, while aggressive correction can introduce new errors. For candidate suggestions, evaluate whether the intended correction appears and how highly it ranks. Preserve a way to review or undo replacements. A spell checker supports editing, but final review still needs to consider context, numbers, terminology, and the document's purpose.

People also ask

Does a spell checker understand the whole sentence?

Some contextual tools use surrounding text, while simpler tools primarily check individual words. Capabilities vary and should be tested.

Is autocorrect the same thing?

Autocorrect applies replacements, often automatically. A spell checker may only flag or suggest, so the user interaction and consequences differ.

Can it handle languages with many word forms?

It can, when its dictionaries, morphological rules, or models support them. Coverage depends on the language resources and implementation.

Check your understanding

In the toy example, plan is more common than palm, but palm has the larger combined score. Is that inconsistent?

Answer: No. Ranking combines the candidate prior with the error likelihood. The assumed transposition likelihood makes palm's product larger; frequency alone does not determine the decision.

Related terms

  • Edit distance
  • Language model
  • Noisy channel model
  • autocorrect
  • morphological analysis
  • text normalization
  • grammar checking

Learn next

Collect examples of non-word errors, real-word errors, and valid unfamiliar terms. Compare which a dictionary-only checker could detect. For two candidate corrections, separate evidence about word frequency from evidence about how the typo could have occurred.

More in Natural language and speech

  • Speech corpus - A speech corpus is an organized collection of speech recordings assembled for research, development, or evaluation.
  • Speech segmentation - Speech segmentation is the identification of boundaries between units in spoken language, such as words, syllables, or speech sounds.
  • Speech synthesis - Speech synthesis is the artificial generation of speech audio by a computer or other system.
  • SPL notation - SPL notation is a structured notation for sentence plans, associated with the Sentence Plan Language developed for the Penman natural-language generation...
  • Split-half reliability - Split-half reliability is an approach to assessing measurement consistency by dividing a set of measurement contributions into two parts and comparing the...
  • Spoken dialog system - A spoken dialog system is a computer system that interacts with a person through spoken conversation.

Sources

Peter Norvig, How to Write a Spelling Corrector: https://www.norvig.com/spell-correct.html

Hunspell, primary project overview: https://hunspell.github.io/

Primary author explanation and project documentation were read. The plam candidate scores are original illustrative values, not corpus estimates or outputs from either source's implementation.

Previous: Speedy search Next: Spherical contact distribution function

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer