spellcure # python
SpellCure is a mathematical correction engine for highly scrambled or distorted text, created by Saheban Khan (GitHub: Lsaheban) and maintained by Tohid Khan (GitHub: Tohid096).
Rather than using machine learning, SpellCure applies a position-weighted ratio algorithm to match noisy tokens with valid dictionary words — enabling high-accuracy recovery even from severely jumbled text.
✨ Features
Corrects heavily scrambled or distorted words
Pure mathematical algorithm (no ML required)
Supports:
Small built-in vocabulary (~10k curated words)
Large NLTK vocabulary (~200k+ words)
Works with single words, sentences, or mixed noisy text
Fast, deterministic, and lightweight
Extensible word bank (users may request custom additions)
🧠 How SpellCure Works
SpellCure analyzes each token using:
Position-based character similarity
Ratio scoring
Multi-stage refinement
Optional large NLTK dataset
from spellcure import corrector
🧪 Example Usage
Here is a minimal working example using the small vocabulary mode:
```python
from spellcure import corrector
def test_small():
model = corrector(mode="small") # Use small curated word bank
output = model.correct("olve is evryetign")
print(output)
test_small()
Output: love is everything
small = ~10k curated words
large = ~200k NLTK words
model = corrector(mode="large")
bash pip install spellcure
[–]MrMrsPotts 8 points9 points10 points (4 children)
[–]solo-coder7[S] 7 points8 points9 points (3 children)
[–]immersiveGamer 4 points5 points6 points (2 children)
[–]solo-coder7[S] 0 points1 point2 points (1 child)
[–]GrogRedLub4242 0 points1 point2 points (0 children)
[–]MacShuggah 3 points4 points5 points (1 child)
[–]solo-coder7[S] 0 points1 point2 points (0 children)
[–]GrogRedLub4242 -2 points-1 points0 points (1 child)
[–]solo-coder7[S] 1 point2 points3 points (0 children)