No project description provided
Project description
Spell-Checker: Wrote studying LeetCode 75 Problems
Introduction
Writing Spell-checker is a challenge due to the complicated nature of searching and matching correct matches of user written words. Thus, providing correct spellings.
StackOverflow and Wikipedia offer in-depth knowledge in writing a spell-checker but are quite limited and outdated. It’s quite difficult to reverse engineer the spell checker ones present in Windows 11 by default. Including spell-checker has fundamental rules and later others tweak them to make it faster and add more features.
Establishing no prior rules how it should work, and present Neural Spell Checkers being prominent in Grammarly and Google Docs, I went on quest to write a spell checker from scratch using my understanding of Algorithms specifically LeetCode problems I solved in the past couple of weeks and reading through Articles.
Structure of SpellChecker
A unique and similar structure of past and present spell checkers were derived while designing this Algorithm. Starting
- A Prefix Tree search Algorithm to load every word from the dictionary into its respective nodes
- Iterating over the words and using Longest Common Sequence (LCS) to find most likely match for the input word
- Edit Distance (Levenshtein Distance) to determine the perfect match and returning result.
Word with highest LCS and lowest Edit distance is determined as a perfect match.
Learning outcomes
Practising LeetCode concepts in a real world project is valuable. Including better understanding how different Algorithms come into play and work to solve a critical problem in a unified manner. And showcasing problem solving and creativity traits.
LeetCode Problems (used)
- Edit Distance
- Longest Common Sequence
- Implement a Trie
These were part of LeetCode 75 Problems. https://leetcode.com/studyplan/leetcode-75/
Critical Pointers
- I don’t provide UI and interface to interact with the algorithm. A terminal interface needs to be utilised.
- A Public dictionary dataset was used.
- The clearest explanation of Spell Checker Algorithm and Code on the Internet.
- Time Complexity O(n * m * (m + m))
Consider star the repository if it helps you!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spell4checker-0.0.1.tar.gz
.
File metadata
- Download URL: spell4checker-0.0.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8236cdc69a5c7d0be56ac455f7ad7ad11689eba1f6520217a73d5402205dd0f2 |
|
MD5 | 5fc9cc896204170c19fb0076ee5594de |
|
BLAKE2b-256 | d10bd8f9bfd261a8689292b1f86a7c091a15c128525dabdcfcd4bb38a5c57bb8 |
File details
Details for the file spell4checker-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: spell4checker-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 993df0558990d83177c9e22eac7cb9a85474dd22207fe30e420b98a4f9d4604a |
|
MD5 | e65328f70388ec7c359699f656fd66fe |
|
BLAKE2b-256 | 72875389239721cace83a720fc510e31603c52d3b0b43f4b5a0b2d036e836456 |