Skip to content

Text 0.4.0 soundex

github-actions[bot] edited this page Aug 21, 2026 · 1 revision

Lodestar.Text 0.4.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

Soundex

American Soundex: an initial letter followed by three digits.

public static class Soundex

Example — the collision the algorithm is famous for.

using Lodestar.Text.Phonetics;

string robert = Soundex.Encode("Robert");  // => R163
string rupert = Soundex.Encode("Rupert");  // => R163

Remarks — the oldest of the three and the one most likely to be what an existing system already uses. It keeps the first letter, then maps the rest to digits by articulation — bfpv1, cgjkqsxz2, dt3, l4, mn5, r6 — dropping vowels, and pads or truncates to exactly four characters.

Four characters is why it merges so much: over the 402-word corpus it pins, 101 words share a code with at least one other. That is the point of it — recall first — and the reason not to reach for it when a wrong match is expensive.

Reference behaviour is jellyfish.soundex, matched over 402 words.

Applies to — net10.0, netstandard2.0.

See alsoNysiis, Metaphone, the phonetics index.

Members

Member What it does
Soundex.Encode The 4-character Soundex code of one word.

Lodestar

Project

Clone this wiki locally