Skip to main content

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

  1. A Prefix Tree search Algorithm to load every word from the dictionary into its respective nodes
  2. Iterating over the words and using Longest Common Sequence (LCS) to find most likely match for the input word
  3. 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)
  1. Edit Distance
  2. Longest Common Sequence
  3. Implement a Trie

These were part of LeetCode 75 Problems. https://leetcode.com/studyplan/leetcode-75/

Critical Pointers
  1. I don’t provide UI and interface to interact with the algorithm. A terminal interface needs to be utilised.
  2. A Public dictionary dataset was used.
  3. The clearest explanation of Spell Checker Algorithm and Code on the Internet.
  4. Time Complexity O(n * m * (m + m))

Consider star the repository if it helps you!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spell4checker-0.0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

spell4checker-0.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

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

Hashes for spell4checker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8236cdc69a5c7d0be56ac455f7ad7ad11689eba1f6520217a73d5402205dd0f2
MD5 5fc9cc896204170c19fb0076ee5594de
BLAKE2b-256 d10bd8f9bfd261a8689292b1f86a7c091a15c128525dabdcfcd4bb38a5c57bb8

See more details on using hashes here.

File details

Details for the file spell4checker-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for spell4checker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 993df0558990d83177c9e22eac7cb9a85474dd22207fe30e420b98a4f9d4604a
MD5 e65328f70388ec7c359699f656fd66fe
BLAKE2b-256 72875389239721cace83a720fc510e31603c52d3b0b43f4b5a0b2d036e836456

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page