Correct the mistakes of the character recognition software

Instructions:
Character recognition software is widely used to digitise printed texts. Thus the texts can be edited, searched and stored on a computer.

When documents (especially pretty old ones written with a typewriter), are digitised character reco…


This content originally appeared on DEV Community and was authored by Madalina Pastiu

Instructions:
Character recognition software is widely used to digitise printed texts. Thus the texts can be edited, searched and stored on a computer.

When documents (especially pretty old ones written with a typewriter), are digitised character recognition softwares often make mistakes.

Your task is correct the errors in the digitised text. You only have to handle the following mistakes:

S is misinterpreted as 5
O is misinterpreted as 0
I is misinterpreted as 1
The test cases contain numbers only by mistake.

Solution
Solution
Output
Output

Thoughts:
I have used the replaceAll() string function to replace all 5s, 1s and 0s to S, I and O. And functional chaining to have a concise and readable code.

This is a CodeWars Challenge of 8kyu Rank (https://www.codewars.com/kata/577bd026df78c19bca0002c0/train/javascript)


This content originally appeared on DEV Community and was authored by Madalina Pastiu


Print Share Comment Cite Upload Translate Updates
APA

Madalina Pastiu | Sciencx (2025-03-18T22:36:00+00:00) Correct the mistakes of the character recognition software. Retrieved from https://www.scien.cx/2025/03/18/correct-the-mistakes-of-the-character-recognition-software/

MLA
" » Correct the mistakes of the character recognition software." Madalina Pastiu | Sciencx - Tuesday March 18, 2025, https://www.scien.cx/2025/03/18/correct-the-mistakes-of-the-character-recognition-software/
HARVARD
Madalina Pastiu | Sciencx Tuesday March 18, 2025 » Correct the mistakes of the character recognition software., viewed ,<https://www.scien.cx/2025/03/18/correct-the-mistakes-of-the-character-recognition-software/>
VANCOUVER
Madalina Pastiu | Sciencx - » Correct the mistakes of the character recognition software. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/03/18/correct-the-mistakes-of-the-character-recognition-software/
CHICAGO
" » Correct the mistakes of the character recognition software." Madalina Pastiu | Sciencx - Accessed . https://www.scien.cx/2025/03/18/correct-the-mistakes-of-the-character-recognition-software/
IEEE
" » Correct the mistakes of the character recognition software." Madalina Pastiu | Sciencx [Online]. Available: https://www.scien.cx/2025/03/18/correct-the-mistakes-of-the-character-recognition-software/. [Accessed: ]
rf:citation
» Correct the mistakes of the character recognition software | Madalina Pastiu | Sciencx | https://www.scien.cx/2025/03/18/correct-the-mistakes-of-the-character-recognition-software/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.