Skip to content
This repository was archived by the owner on Aug 2, 2020. It is now read-only.
/ soundex Public archive

An implementation of the Soundex algorithm in Elixir.

License

Notifications You must be signed in to change notification settings

carljv/soundex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Examples:

iex> Soundex.soundex("Morris")
"M620"

iex> Soundex.soundex("Harris")
"H620"  

iex> Soundex.soundex("Morrison")
"M625"

iex> Soundex.soundex("Smith")
"S530"

iex> Soundex.soundex("Smithie")
"S530"           

Details

Soundex only encodes letters from the English alphabet. So, for example, punctuation in names is ignored:

iex> Soundex.soundex("O'Brien") == Soundex.soundex("OBrien")
true

As are spaces:

iex> Soundex.soundex("Van Dyke") == Soundex.soundex("Vandyke")

Unicode letters are also ignored:

iex> Soundex.soundex("Piñata") == Soundex.soundex("Pinata")
false

iex> Soundex.soundex("Piñata") == Soundex.soundex("Piata")
true

One exception to this is the German esszet, which Unicode treats as two S's:

iex> Soundex.soundex("Straßer") == Soundex.soundex("Strasser")
true

About

An implementation of the Soundex algorithm in Elixir.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages