Blog

Matching Vietnamese posts, with or without accents

· The Subty team

If you monitor Vietnamese-language groups, there is one detail that decides whether the tool works: what it does with diacritics.

The problem

The same sentence gets typed two ways. On a phone with a Vietnamese keyboard: “Cần xe chở hàng Hà Nội”. On a laptop in a hurry, or with an English keyboard: “can xe cho hang ha noi”.

Both are completely normal. Both mean the same thing. A tool that matches only the accented form will silently miss every post written the other way, and the user will conclude the group is quiet when it is not.

What Subty does

Every post is stored twice internally: once normalised with accents intact, and once with diacritics removed. Your keywords are processed the same way.

A match on either form counts. So a keyword typed “can xe” finds a post written “Cần xe”, and a keyword typed “Cần xe” finds a post written “can xe”.

The letter đ is handled explicitly, because unlike every other Vietnamese diacritic it does not decompose automatically — “đi” has to become “di”, and a naive implementation leaves it alone.

Why phrases still matter

Accent-insensitive matching makes single words riskier, not safer: stripped of accents, more words collide. This is another reason to use phrases of two or three words rather than single terms.

What you need to do

Nothing. Type your phrases whichever way is natural for you. Both forms are covered.

Stop refreshing Facebook.

Set up your first group in about two minutes, and let Subty do the watching.