Smart Keyboard: how it decides to change a word
You type a sentence, look up, and see «ghbdtn» instead of «привет». The layout was still English. You delete the word, switch the layout and type it again. People who write in two or three languages do this many times a day. VerbaIDE can now do it for you. The feature is called Smart Keyboard.
What it does
When a word ends — with a space, a comma or a full stop — Smart Keyboard looks at it. If it was typed in the wrong layout, the word is replaced and the system layout switches, so the next word comes out right. «ghbdtn» becomes «привет», «руддщ» becomes «hello», and a Ukrainian «тыльки» typed on the Russian layout becomes «тільки». It also fixes simple typos in the right layout: «првиет» becomes «привет», «квказ» becomes «Кавказ». And both at once: «ghdbtn» becomes «привет».
If a fix is wrong, press ⇧ twice. The word and the layout come back, and that word is never fixed again. Press ⇧ twice once more and the fix returns.
The rule we set first
A missed fix costs you one retype. A wrong fix costs more: you have to notice it, and sometimes you notice only after the message is sent. So before writing any code we set a limit: at most one wrong replacement per 10,000 correctly typed words. Every decision below was measured against it.
How it decides
Everything happens on your Mac. Smart Keyboard looks at three things.
The macOS spell checker — the same dictionary that underlines words in red. It answers «is this a word?». We ship no dictionaries of our own.
Tables of three-letter runs. For each language we counted which runs of three letters occur at the start, in the middle and at the end of words, and how often. «ghb» at the start of an English word almost never happens; «при» at the start of a Russian word is everywhere. We counted on public-domain sentences from the Common Voice project. The app carries only the tables, 22–43 KB per language, not the sentences.
Lists of frequent words from the same sentences: the 300 most frequent short words of each language, and a longer frequency list for choosing between typo fixes.
Short words needed their own rule. The spell checker accepts almost any single letter and many pairs, like «cd» or «bc», so for one and two letters we trust only the frequent-word lists. A lone Latin letter typed on the English layout is never fixed by itself: in our test that would have turned «E», «C», «J» and «R» into Cyrillic letters 52 to 65 times per 10,000 words. Such a letter is fixed only together with the word next to it.
Russian and Ukrainian are a separate story. Their layouts differ in only a few keys: «ы» and «і», «э» and «є», «ъ» and «ї». The dictionaries decide, but the Russian one in macOS has gaps: it may not know «продавцы» while the Ukrainian one knows «продавці». So a dictionary answer is not enough on its own: the letter tables have to agree too. Words that exist in both languages, like «ты» and «ті», are decided by the words around them, and it takes two such words. With one, a mixed Ukrainian and Russian text got 15 wrong replacements per 10,000 words.
For a typo, the candidates are the spell checker’s suggestions plus the words one slip away from what you typed: one letter wrong, missing or extra, or two letters swapped. Our own variants count only if they are in the frequency list. The most frequent candidate wins, and only if it looks more like the language than what you typed.
How we measured
We kept part of the Common Voice sentences aside and built nothing from them: 111,373 correctly typed words in English, Russian and Ukrainian, plus the same words typed in the wrong layout. The test types them key by key and asks the real macOS spell checker.
- Wrong layout. Of words five letters and longer, 99.2% were fixed (Ukrainian: 96.4%). Short words are harder: of two-letter words, 65–78%.
- Wrong replacements. 10 of the 111,373 correct words, 0.9 per 10,000. All ten were words the test had misspelled on purpose. Correctly spelled words were never touched.
- English inside Russian and Ukrainian. «Slack», «PR», «API», «GitHub», «to», «is» and 16 more words inserted into Russian and Ukrainian sentences: 18,400 insertions, none replaced.
- Typos. On correct text: 4 wrong replacements in 50,562 English words, 3 in 39,664 Russian words, 1 in 15,760 Ukrainian words. Fixed: about 83% of English typos, 66% of Russian and 40% of Ukrainian.
Then we checked the typo rule on text it had never been tuned on: the app’s own interface strings, the phrases of our dictation test set and our own Russian working notes. English and Ukrainian: no wrong replacements. Russian: one in 22,756 words — «нодах» became «годах».
What we turned off because it hurt
The judge for typos. VerbaIDE has a small local model, our fine-tuned Qwen3-1.7B, which already checks dictionary terms in dictation. We let it look at a typo fix again once the next word was typed. It changed the word for the worse more often than for the better: in Russian it spoiled 67 words and saved 23, in English 58 and 53, in Ukrainian 8 and 2. Before that, when it chose between several typo candidates, it picked a wrong word in 23–29% of questions. Both are off.
The same model stayed on for wrong-layout words where the letter tables are undecided. There it raised the share of fixed long words from 97.7% to 99.2% (Ukrainian from 90.6% to 96.4%), at the cost of four more wrong replacements on 111,373 words, all on words misspelled on purpose. 95 of its 100 answers come within 34 milliseconds.
A lone «э» becoming «є». On the Russian layout «э» sits on the key that types a quote mark in English. An English sentence that started with a quote on the wrong layout got «Є» instead of the quote 20 times in the test. Off.
The bold typo setting. It fixed 92% of Russian typos, but changed 8.8 correct Russian words per 10,000, and 71 words of the Russian text we had kept aside for checking. We took the stricter one: 66% fixed, under one wrong replacement per 10,000.
What stays on your Mac
All of it. Keys are processed on your Mac. Layout correction processes the actual field text before the cursor in memory, back to the sentence start, up to 16,384 UTF-16 units; the snapshot is then forgotten. The last correction is kept for undo. Nothing you type is saved, written to the log or sent anywhere. Smart Keyboard uses Accessibility permission to listen to keys and type corrections, skips password fields and excluded apps, and pauses corrections while VerbaIDE is dictating.
Smart Keyboard is a paid feature, part of the plan and of the 30-day trial. What it fixes, what it leaves alone and what it will not catch is on the Smart Keyboard page.