Micro Challenge #37 – Checking your spelling

29 June 2020 - 3 minute read

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

This week, we are looking at how computers ‘learn’ and store new information. It might be useful to review Challenge 11 and Challenge 12 on computer programming.

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:

WordCommon MistakesTyping Errors
ReceiveRecieve, Resieve, ReseiveReveive, Rexeive, Receuve 

Note: Typing errors here are based on the QWERTY keyboard set-up

Or you could present it like this:

MistakePossible Correct Options
ReveiveRevive, Receive

In both cases, you are determining what common mistakes an English writer might make and programming the computer to recognise these!

The Challenge:

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:

  • Algorithm
  • Boolean
  • Definition
  • Iteration 
  • Pseudocode

Review it:

  • 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’?

Advanced:

  • Could you create an algorithm or pseudocode for one of the word substitutions? 

Win a micro:bit!

Don’t forget: If you submit your response to Challenge #32 via the Share It options below before the 30th of June (that’s tomorrow!), you will be entered into a prize draw for one of 5 micro:bits.

  • The giveaway is open to any young person aged between 14 and 18 based in the UK. 

Share it

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 challenges@altitudefoundation.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:



Leave a comment

Leave a Reply