Dotted words are ones the engine wasn't sure about. Select one to see other spellings.
Grey text was kept as typed: links, English, numbers.
How accurate is it?
Each setup converts a set of real sentences, and we count how many words come out the way a person wrote them. Spellings Persian writers disagree on count as right: میکنم, میکنم and می کنم are the same word, and so are زمانیکه and زمانی که.
Some mistakes
What's inside
A small character-level network and a rule engine, both running in plain JavaScript in this tab. No server, no API key.
What you download
| Code: rules, tokenizer, decoder | 21.4 KiB |
| Word frequencies and vowels | 68.6 KiB |
| The model's weights | 84.4 KiB |
| Sentence context (optional) | 73.6 KiB |
Compressed sizes. The best setup, both engines together, is 174 KiB, about the size of one photo.
How a sentence is converted
- Links, emails, numbers, code and English words are set aside and kept exactly as typed.
- Each remaining word gets a handful of possible Persian spellings, from the rules and from the model.
- The spellings are ranked by how well they fit what was typed and how common they are.
- A last pass looks at position: a word that ends a sentence may take the ه of خوبه.
Speed
A keystroke re-converts only the word being typed, in well under a millisecond. A whole new sentence takes about 35 ms the first time.
Source, measurements and known limits are in the project README.