Skip to content

ByronBecker/motoko-soundex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

motoko-soundex

An implementation of the American Soundex algorithm in Motoko

Usage

Generate the SoundexMapping (or your own custom soundex mapping), as well as a string, and apply the American Soundex algorithm to it https://en.wikipedia.org/wiki/Soundex#American_Soundex

Note: The algorithm returns a result type, and will return an error if passed an empty string

Example usage:

import Soundex "mo:soundex/Soundex"
let soundex = Soundex.Soundex();
let codeTymcazk = Soundex.toSoundexCode(soundex, "Tymczak");  // yields ("T520")
let codeRupert = Soundex.toSoundexCode(soundex, "Rupert");  // yields ("R163")

About

The American Soundex algorithm implemented in Motoko

Resources

License

Stars

Watchers

Forks

Packages

No packages published