Welcome to the thirty-seventh of Altitude Foundation’s #MicroChallenges2020
Today’s challenge will help you understand the basics of programming a spellchecker
What’s a Micro Challenge?
These challenges are short activities to help you develop, revise or refresh your coding skills, posted every Monday, Wednesday and Friday.
Micro Challenge #37
We use spellcheck almost every day – and for most of us, we’ve got used to relying on predictive text as well. But how does the computer know what we mean to write? We have to programme to understand key rules, which allow it to correct and offer suggestions.
There are multiple ways you can ‘programme’ your spell check:
You could present it like this:
|Word||Common Mistakes||Typing Errors|
|Receive||Recieve, Resieve, Reseive||Reveive, Rexeive, Receuve|
Note: Typing errors here are based on the QWERTY keyboard set-up
Or you could present it like this:
|Mistake||Possible Correct Options|
In both cases, you are determining what common mistakes an English writer might make and programming the computer to recognise these!
For today’s challenge, you will build a small version of a spellchecker for 5 words. You can use either of the above models and use your own common misspellings or our suggestions below:
- Double check that you are happy that you have all ‘reasonable’ misspellings – paying particular attention to potential typing errors
- Is one of the above models faster to ‘programme’?
- Could you create an algorithm or pseudocode for one of the word substitutions?
Win a micro:bit!
- The giveaway is open to any young person aged between 14 and 18 based in the UK.
We would love to see what you have created! Please send any pictures, videos, or files of your activities to us – either via Facebook, Twitter or Instagram using #MicroChallenges2020 or to firstname.lastname@example.org. If you are emailing them to us, please let us know if you are happy for us to share your stuff on our social media platforms (with credit, of course).
Sign-up here to receive a weekly email with Micro Challenges top tips and solutions: