phonetics

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

README

go-phonetics

A go phonetics algorithm library

Implemented algorithms:

Usage

Get the latest tagged version:

go get github.com/tilotech/go-phonetics

Example:

import "github.com/tilotech/go-phonetics"

func main() {
  metaphoneEncoded := phonetics.EncodeMetaphone("Hello World!")
  soundexEncoded := phonetics.EncodeSoundex("Hello World!")
  fmt.Println(metaphoneEncoded, soundexEncoded)
}

More information can be found in the godocs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DifferenceSoundex

func DifferenceSoundex(word1, word2 string) int

DifferenceSoundex is a function to calculate difference between two strings with Soundex algorithm. Function returns a ranking on how similar two words are in percents.

func EncodeCologne

func EncodeCologne(word string) string

EncodeCologne is a function to encode string with the Cologne Phonetics algorithm.

See https://en.wikipedia.org/wiki/Cologne_phonetics.

func EncodeMetaphone

func EncodeMetaphone(word string) string

EncodeMetaphone is a function to encode string with Metaphone algorithm. Metaphone is a phonetic algorithm, published by Lawrence Philips in 1990, for indexing words by their English pronunciation. With Michael Kuhn modification (mkuhn@rhlab.UUCP)

func EncodeSoundex

func EncodeSoundex(word string) string

EncodeSoundex is a function to encode string with Soundex algorithm. Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL