ZWNJ fixer (نیمفاصله)
Persian text copied from web pages, chats or PDFs often uses an ordinary space where a half-space (نیمفاصله, ZWNJ) belongs: «می شود» instead of «میشود», «کتاب ها» instead of «کتابها». This tool finds the common cases and fixes them, shows you a diff of every change, and only replaces your text when you press Apply. It changes nothing except spaces and ZWNJ.
How to use
- Paste the Persian text.
- Press “Check”. Changes are listed as a diff: removed spaces in red, inserted half-spaces highlighted.
- Review the list. The count shows how many fixes of each kind were made.
- Press “Apply” to replace your input, then copy it or open it in the notepad.
What it does
- Joins the verb prefixes می and نمی to the following word (می شود → میشود).
- Joins the suffixes ها، های، هایی، تر، ترین and ای (after a final ه) to the preceding word.
- Collapses spaces around an existing half-space and repeated half-spaces.
- Shows a diff with every change made visible before applying.
- Preserves diacritics (harakat), digits, punctuation and all letters exactly as typed.
What it doesn’t
- It does not convert Arabic ي/ك to Persian ی/ک or change any letter; it only swaps spaces for ZWNJ.
- It does not understand grammar: «می» as a standalone word (wine) followed by a verb-like word will be joined too. Check the diff.
- It does not add ZWNJ for compounds it cannot recognise by pattern (for example بینالمللی).
Limits
- Only the suffixes and prefixes listed above are handled. Other common half-space cases must be fixed by hand.
- Words like «تر» (wet) or «ای» as an interjection can be false positives; the diff exists so you can decide.
Questions
What is a ZWNJ?
Zero-width non-joiner, U+200C — the Persian half-space (نیمفاصله). It stops two letters from joining without inserting a visible gap. «میشود» uses one; «می شود» uses a normal space and is typographically wrong.
How do I type a half-space myself?
On Persian keyboard layouts press Shift+Space. On the standard Windows Persian layout it is Ctrl+Shift+2; on macOS Shift+Space or Option+Space, depending on the layout.
Will my diacritics (اعراب) be kept?
Yes. The patterns match letters with or without harakat and only replace the space, so فتحه، کسره and the others stay exactly where they are.
Why show a diff instead of just fixing?
Pattern-based fixes can be wrong for rare words. The diff shows each change so you accept them knowingly, and your input is untouched until you press Apply.
Does it work for Arabic or Urdu?
The patterns are Persian grammar. Arabic text passes through unchanged; Urdu text may be affected only where the same Persian suffixes appear.
Is the text uploaded?
No. The fixer runs in your browser and works offline after the first visit.