Update README.md
Browse files
README.md
CHANGED
|
@@ -1,144 +1,154 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
##
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
##
|
| 58 |
-
|
| 59 |
-
``
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
##
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
```
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
##
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets: generated-misspelling-words
|
| 4 |
+
pipeline_tags:
|
| 5 |
+
- rust
|
| 6 |
+
- misspelling-words
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Autocorrect-Type
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+

|
| 15 |
+

|
| 16 |
+

|
| 17 |
+

|
| 18 |
+

|
| 19 |
+
|
| 20 |
+
System-wide autocorrect for Windows. Runs silently in the background and fixes misspelled words as you type -- in any application (terminal, browser, Discord, search bar, etc.).
|
| 21 |
+
|
| 22 |
+
Built with Rust + Windows API. No external APIs, no cloud dependencies, no AI -- fully offline and native.
|
| 23 |
+
|
| 24 |
+
Handles 466k English words sourced from [english-words](https://github.com/dwyl/english-words).
|
| 25 |
+
You can download the misspelling datasets [here](https://huggingface.co/datasets/algorembrant/generated-misspelling-words) and make sure to rename the file into `misspellings.txt` and place it on `*\data\` folder path.
|
| 26 |
+
|
| 27 |
+
## Features
|
| 28 |
+
|
| 29 |
+
- **System-wide** -- works in any text input across your entire system
|
| 30 |
+
- **500+ common misspellings** -- instant, high-confidence corrections (e.g. `teh` -> `the`)
|
| 31 |
+
- **Smart spell checking** -- edit-distance algorithm catches unknown typos against a 466k-word dictionary
|
| 32 |
+
- **Clipboard-based replacement** -- corrections happen instantly, no visible cursor movement
|
| 33 |
+
- **Case-preserving** -- respects your capitalization (`TEH` -> `THE`, `Teh` -> `The`)
|
| 34 |
+
- **System tray** -- toggle on/off, runs silently in background
|
| 35 |
+
- **Lightweight** -- single `.exe`, no runtime dependencies, tiny memory footprint
|
| 36 |
+
|
| 37 |
+
## System Overview
|
| 38 |
+
|
| 39 |
+
```mermaid
|
| 40 |
+
graph TD
|
| 41 |
+
A[Keyboard Input] -->|WH_KEYBOARD_LL| B[hook.rs]
|
| 42 |
+
B -->|Word buffer| C{Trigger key?}
|
| 43 |
+
C -->|No| B
|
| 44 |
+
C -->|Yes| D[spellcheck.rs]
|
| 45 |
+
D -->|Known misspelling| E[Misspellings DB]
|
| 46 |
+
D -->|Unknown word| F[Edit-Distance Engine]
|
| 47 |
+
F -->|Match found| G[Dictionary - 466k words]
|
| 48 |
+
E --> H[replacer.rs]
|
| 49 |
+
G --> H
|
| 50 |
+
H -->|Clipboard swap| I[Corrected Text]
|
| 51 |
+
J[tray.rs] -->|Toggle / Exit| B
|
| 52 |
+
K[main.rs] -->|Init| B
|
| 53 |
+
K -->|Init| D
|
| 54 |
+
K -->|Init| J
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Requirements
|
| 58 |
+
|
| 59 |
+
### To run the compiled `.exe`
|
| 60 |
+
|
| 61 |
+
- Windows 10/11
|
| 62 |
+
|
| 63 |
+
### To build from source
|
| 64 |
+
|
| 65 |
+
- [Rust toolchain](https://rustup.rs/) (stable)
|
| 66 |
+
|
| 67 |
+
## Build
|
| 68 |
+
|
| 69 |
+
```bash
|
| 70 |
+
cargo build --release
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
The binary will be at `target/release/autocorrect-type.exe`.
|
| 74 |
+
|
| 75 |
+
## Usage
|
| 76 |
+
|
| 77 |
+
### Run
|
| 78 |
+
|
| 79 |
+
Double-click `autocorrect-type.exe` or run from terminal. The app appears in the system tray.
|
| 80 |
+
|
| 81 |
+
```bash
|
| 82 |
+
# if it didnt open then
|
| 83 |
+
cargo run --release
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
### Controls
|
| 87 |
+
|
| 88 |
+
| Action | How |
|
| 89 |
+
|---|---|
|
| 90 |
+
| Toggle ON/OFF | `Ctrl + Alt + A` or right-click tray icon |
|
| 91 |
+
| Exit | Right-click tray -> "Exit" |
|
| 92 |
+
|
| 93 |
+
### How it works
|
| 94 |
+
|
| 95 |
+
1. Type normally in any application
|
| 96 |
+
2. When you press **Space**, **Enter**, **Tab**, or punctuation, the app checks the word you just typed
|
| 97 |
+
3. If it is a known misspelling or a close match to a dictionary word, it is instantly replaced via the clipboard (no cursor flicker)
|
| 98 |
+
4. A small balloon notification shows the correction briefly
|
| 99 |
+
|
| 100 |
+
## How the correction works (no cursor flicker)
|
| 101 |
+
|
| 102 |
+
Unlike typical autocorrect tools that backspace and retype characters visibly, this engine uses a clipboard-based approach:
|
| 103 |
+
|
| 104 |
+
1. Saves current clipboard contents
|
| 105 |
+
2. Sends backspaces to delete the misspelled word
|
| 106 |
+
3. Copies the correction to the clipboard
|
| 107 |
+
4. Simulates `Ctrl+V` to paste instantly
|
| 108 |
+
5. Restores the original clipboard
|
| 109 |
+
|
| 110 |
+
This makes corrections appear instantaneous with no visible cursor movement.
|
| 111 |
+
|
| 112 |
+
## Customization
|
| 113 |
+
|
| 114 |
+
### Add words to the dictionary
|
| 115 |
+
|
| 116 |
+
Add words to `data/user_words.txt` (one per line, auto-created next to the `.exe`). Restart the app after editing.
|
| 117 |
+
|
| 118 |
+
### Expand the misspellings database
|
| 119 |
+
|
| 120 |
+
Edit `data/misspellings.txt`. Format: `misspelling=correction`, one per line. Lines starting with `#` are comments. The file is embedded at compile time.
|
| 121 |
+
|
| 122 |
+
## Project Structure
|
| 123 |
+
|
| 124 |
+
```text
|
| 125 |
+
autocorrect-type/
|
| 126 |
+
βββ Cargo.toml
|
| 127 |
+
βββ Cargo.lock
|
| 128 |
+
βββ LICENSE
|
| 129 |
+
βββ README.md
|
| 130 |
+
βββ .gitignore
|
| 131 |
+
βββ src/
|
| 132 |
+
| βββ main.rs
|
| 133 |
+
| βββ hook.rs
|
| 134 |
+
| βββ spellcheck.rs
|
| 135 |
+
| βββ replacer.rs
|
| 136 |
+
| βββ tray.rs
|
| 137 |
+
βββ data/
|
| 138 |
+
βββ words.txt
|
| 139 |
+
βββ misspellings.txt
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
## Citation
|
| 143 |
+
|
| 144 |
+
```bibtex
|
| 145 |
+
@software{autocorrect_type,
|
| 146 |
+
author = {Rembrant Oyangoren Albeos},
|
| 147 |
+
title = {Autocorrect-Type},
|
| 148 |
+
year = {2026},
|
| 149 |
+
publisher = {Hugging Face},
|
| 150 |
+
url = {https://huggingface.co/algorembrant/autocorrect-type}
|
| 151 |
+
}
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
|