Skip to main content

SpellCure — correction engine for highly scrambled text

Project description

SpellCure

SpellCure is a mathematical correction engine for highly scrambled or distorted text, created by Saheban Khan.
Instead of machine learning, SpellCure uses a position-weighted ratio algorithm to compute similarity between distorted tokens and valid dictionary words.

It is designed to recover words even when the input is heavily jumbled — far beyond simple typo correction.


✨ Features

  • Corrects heavily scrambled words
  • Pure math-based algorithm — no ML required
  • Supports both a small built-in vocabulary and NLTK’s large word corpus
  • Works on sentences, single words, or mixed noisy text
  • Fast, deterministic, and easy to integrate in other projects

🧠 How SpellCure Works

SpellCure compares each input token against vocabulary words using:

  • position-based character similarity
  • ratio scoring
  • recursive refinement steps
  • optional large NLTK vocabulary

This allows SpellCure to recover the correct word even when the text looks like:

  • "aplpe""apple"
  • "ths si a tset""this is a test"
  • "tihs wrod is msesdy""this word is messy"

EXAMPLE from spellcure import SpellCure

Use small built-in vocabulary

model = SpellCure(mode="small") print(model.correct("ths si a tset"))

Output: this is a test # Use NLTK's large vocabulary

model = SpellCure(mode="large") print(model.correct("aplpe"))

🚀 Installation

Install the library using pip:

pip install spellcure

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

spellcure-1.0.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spellcure-1.0.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file spellcure-1.0.1.tar.gz.

File metadata

  • Download URL: spellcure-1.0.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for spellcure-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8d6a46074fd4c9abbd17e6e984dae1cd2a1231ae6e9a3add690b3301b4c719d1
MD5 5619048756226ccd6430f62c3caa019e
BLAKE2b-256 becbefce3a35092744cb96e4b9aff5d297b82eff74fe99a4f4a7f0635515e3b8

See more details on using hashes here.

File details

Details for the file spellcure-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: spellcure-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for spellcure-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51ef4d98e519fb9a268a187e1ec5221c3a20341673dade55211d37b6cbd29204
MD5 2c6783c18f9d4ff2c708af562fda8746
BLAKE2b-256 51737deb56b1eb3ccae5fb347222629fde9109eacb37b1710465e29a40891b41

See more details on using hashes here.

Supported by

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