Why searching "ucet" should still find "účet"

Typing the fast way, without a diacritic you know belongs there, is normal. A good document search should not punish you for it — here is the plain-language version of how that works, with real examples in four languages.

The problem: one mark, two ways to type a word

Many languages mark a letter with an accent, a hook, a ring or a ligature to change how it sounds: á, é, ě, š, č, ř, ž, ů in Czech, ä, ö, ü, ß in German, é, è, ç in French, á, é, í, ó, ú, ñ in Spanish. On a phone keyboard switched to English, or when typing quickly from memory, it is easy to leave a mark off: typing ucet when the document actually says účet, the Czech word for an invoice or an account. To a search system that compares characters exactly, those are two different strings, and a search for one will not find a document that only contains the other.

The fix: diacritic folding

The plain-language idea is simple: before comparing two pieces of text, fold the diacritics out of both of them — the accents, háčeks and cedillas alike — and compare what is left. "Folding" is the technical term for reducing a marked letter like á down to its plain form, a. Do that consistently to the words you type and to the words stored in the index, and ucet and účet become the same search term, regardless of which one you happened to type and which one is actually on the page. This is a well-established technique in text search generally, not something specific to any one app; it is the same idea behind a search engine finding "cafe" when a page says "café".

Folding does have a cost worth naming plainly: it treats two spellings as equal for matching, so once in a while a completely different word that happens to fold the same way will match too. Czech has a clear example of this: smlouva (a contract) and smlouvá (negotiates, a verb form) are different words, not the same word with an accent added — but once the diacritics are folded out of both, a search for one can also surface a document containing the other. That is the trade-off folding makes, in exchange for not losing real matches to a missed accent.

The other problem: German builds words by joining them together

German (and, to a lesser extent, the other languages here) forms long compound words by joining shorter ones directly, with no space. A cancellation of a rental agreement is a Mietvertragskündigung, built from Mietvertrag (rental contract) and Kündigung (cancellation), joined with a linking "s". A search index that only matches whole words will not find Vertrag inside Mietvertragskündigung, even though the contract is exactly what you are looking for.

Two techniques work together here, and they matter for different reasons. The first is a prefix match: typing Vertrag also matches any word that starts with Vertrag, which is why it finds Vertragsunterlagen (contract documents) on its own. That does not help with Mietvertragskündigung, though, because Vertrag is not the start of that word — Miet is. For that case, the search falls back to a substring-style match, tried only once the prefix match finds nothing, and that fallback is what lets Vertrag surface inside a compound wherever it sits, not only at the front.

Examples across four languages

  • Czech: typing ucet finds účet (an invoice or an account); typing vyuctovani finds vyúčtování (a utility statement).
  • German: typing Vertrag finds Vertragsunterlagen; typing Grundstuck finds Grundstück (a plot of land).
  • French: typing deces finds décès (a death, as on a death certificate); typing francais finds français.
  • Spanish: typing camion finds camión (a truck); typing informacion finds información.

The same idea works in reverse, too: if you happen to type the diacritic correctly, the search still finds a version of the document where it was recognised without one, which can happen when a scan is faint or the recognition step misses a small mark above a letter.

It is not only about how you type

So far this has been about the gap between what you type and what the document says. There is a second, quieter gap worth knowing about: text recognition itself does not always get an accent right. A faint scan, a low-resolution photo, or an unusual typeface can make the small mark above a letter hard to tell apart from a smudge or a shadow, and the recognition step can drop it even though a human reading the same page would not have any trouble. When that happens, the recognised text stored for the document is missing the accent, regardless of how carefully you type your search. Diacritic folding helps here too, in the same direction: if the search also folds the text it is comparing against, a correctly typed účet still finds a page whose recognised text came out as ucet. The folding step, in other words, is protecting you from mistakes on both sides of the search box, not just the one you might make while typing.

How Pocket Aurora Papers' search applies this

Pocket Aurora Papers' offline search folds diacritics for matching, and searches in two passes: it matches word beginnings first, then falls back to a substring-style match only when that finds nothing, which is what lets a word buried in the middle of a German compound surface too. Both passes are tested against a search corpus covering all five recognition languages: English, Czech, German, French and Spanish. It runs entirely on the device, the same as the text recognition step that makes a scanned page searchable in the first place. The app's own interface is English only for now; it is the search behaviour, not the menus and buttons, that understands the other four languages.

Join the waitlist

We will write when there is something to try, and ask what matters most to you before launch.

Join the waitlist