https://github.com/robertov8/soundex
An implementation of the Soundex algorithm in Elixir.
https://github.com/robertov8/soundex
elixir soundex
Last synced: 9 months ago
JSON representation
An implementation of the Soundex algorithm in Elixir.
- Host: GitHub
- URL: https://github.com/robertov8/soundex
- Owner: robertov8
- License: mit
- Created: 2024-01-19T20:17:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-20T16:04:12.000Z (over 2 years ago)
- Last Synced: 2025-08-10T19:16:46.834Z (11 months ago)
- Topics: elixir, soundex
- Language: Elixir
- Homepage: https://hex.pm/packages/soundex
- Size: 413 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Soundex
=======
An module for computing the Soundex codes of strings.
Soundex is an algorithm for representing (mainly English) names as short phonetic codes.
A Soundex code begins with the first letter of the name, followed by three digits.
They are typically used to match like-sounding names.
For more information, see [the Wikipedia entry](http://en.wikipedia.org/wiki/soundex).
## Examples:
iex> SoundexPostgres.soundex("Morris")
"M620"
iex> SoundexPostgres.soundex("Harris")
"H620"
iex> SoundexPostgres.soundex("Morrison")
"M625"
iex> SoundexPostgres.soundex("Smith")
"S530"
iex> SoundexPostgres.soundex("Smithie")
"S530"
## Details
Soundex only encodes letters from the English alphabet. So, for example,
punctuation in names is ignored:
iex> SoundexPostgres.soundex("O'Brien") == SoundexPostgres.soundex("OBrien")
true
As are spaces:
iex> SoundexPostgres.soundex("Van Dyke") == SoundexPostgres.soundex("Vandyke")
Unicode letters are also ignored:
iex> SoundexPostgres.soundex("Piñata") == SoundexPostgres.soundex("Pinata")
false
iex> SoundexPostgres.soundex("Piñata") == SoundexPostgres.soundex("Piata")
true