words.txt. For demonstation, we only use 7 letters combination minimum to generate: Words processed : 125,414
Lines written : 173,110,626
Output file : misspellings_permutations.txt
File size : 2.53 GBMAX_WORD_LEN in the script.generate_permutations_colab.py or google_collab_173MSW.ipynb to generate 173,110,626 misspelling words from 125,414 processed datasets; the output is downloadable at HuggingFacegenerate_typos_colab.py or google_collab_263MSW.ipynb to generate 26,636,990 misspelling words from 415,701 processed datasets; the output is downloadable at Hugging Face| Strategy | Example (hello) | Variants |
|---|---|---|
| Adjacent swap | hlelo, helol | n−1 per word |
| Char deletion | hllo, helo, hell | n per word |
| Char duplication | hhello, heello | n per word |
| Keyboard proximity | gello, jello, hwllo | varies |
misspelling=correction formatpython generate_typos_local.pygenerate_permutations_colab.py (Google Colab)MAX_WORD_LEN = 7 # ← CRITICAL control knob| Resource | Free Tier | Colab Pro ($12/mo) |
|---|---|---|
| Disk | ~78 GB (temporary) | ~225 GB (temporary) |
| RAM | ~12 GB | ~25-50 GB |
| GPU | T4 (limited) | A100/V100 |
| Runtime limit | ~12 hours, then VM resets | ~24 hours |
| Google Drive | 15 GB (persistent) | 15 GB (same) |
[!IMPORTANT] Colab disk is ephemeral — when the runtime disconnects, all files on the VM are deleted. Only Google Drive persists.
1# Cell 1
2from google.colab import files
3uploaded = files.upload() # select words.txt from your PC1# Cell 2
2from google.colab import drive
3drive.mount('/content/drive')
4
5# Then change OUTPUT_PATH in the script to:
6# '/content/drive/MyDrive/misspellings_permutations.txt'generate_permutations_colab.py into a new cell. Adjust MAX_WORD_LEN as needed, then run.1# If saved to VM disk:
2files.download('misspellings_permutations.txt')
3
4# If saved to Google Drive: just access it from drive.google.com[!CAUTION] Full permutations grow at n! (factorial) rate. Here's what to expect:
MAX_WORD_LEN | Max perms/word | Est. total output |
|---|---|---|
| 5 | 120 | ~200 MB |
| 6 | 720 | ~1–2 GB |
| 7 | 5,040 | ~5–15 GB ← recommended start |
| 8 | 40,320 | ~50–150 GB |
| 9 | 362,880 | ~500 GB – 1 TB |
| 10 | 3,628,800 | ~5–50 TB ← impossible |
[!TIP] Start withMAX_WORD_LEN = 6or7, check the output size, then decide if you want to go higher. The script has a built-in safety check that aborts if the estimated size exceeds 70 GB.
Ctrl+Shift+I → Console and paste setInterval(function(){document.querySelector("colab-connect-button").click()}, 60000) to prevent idle disconnects