Challenge 37

🪄

Spellchecker

Open in Code Editor or Copy Instructions
...solutions at bottom of page...

You are designing part of a new text editor - your job is to implement a spellchecker

A list of 31096 English words from the dictionary can be found here

You should create a function that takes in a string and outputs a list of spelling errors, if there are any. The function should return true if there are no spelling mistakes, otherwise return false

Examples:

spellcheck("Hello wrld") would output "Errors: wrld" and return FALSE

spellcheck("Programing is not about typing, it's abot thinking.") would output "Errors: Programing, abot" and return FALSE

spellcheck("The best error message is the one that never shows up") would output "No errors found" and return TRUE

Extension:

Many programs display spelling errors inline with e.g. a red underline. Simulate this by using a red dot before the spelling mistake. You can modify your function to return a string - i.e. for an input of "Hello, wrld", the return value should be "Hello, 🔴wrld"

Solutions

IGCSE 0478 / O-Level 2210 A-Level 9618