Akin.Metaphone (Akin v0.1.7) View Source

Calculates the Metaphone Phonetic Algorithm metric of two strings.

Link to this section Summary

Functions

Callback implementation for Akin.Task.compare/2.

Compares two values phonetically. Return 1 if phonetic representations match, 0 if not.

Link to this section Functions

Link to this function

compare(corpus1, corpus2)

View Source

Specs

compare(
  %Akin.Corpus{
    list: term(),
    original: term(),
    set: term(),
    stems: term(),
    string: term()
  },
  %Akin.Corpus{
    list: term(),
    original: term(),
    set: term(),
    stems: term(),
    string: term()
  }
) :: float()

Callback implementation for Akin.Task.compare/2.

Link to this function

compare(left, right, opts)

View Source

Specs

compare(
  %Akin.Corpus{
    list: term(),
    original: term(),
    set: term(),
    stems: term(),
    string: term()
  },
  %Akin.Corpus{
    list: term(),
    original: term(),
    set: term(),
    stems: term(),
    string: term()
  },
  Keyword.t()
) :: float()

Compares two values phonetically. Return 1 if phonetic representations match, 0 if not.

Examples

iex> Akin.Metaphone.compare(Akin.Util.compose("Colorado"), Akin.Util.compose("Kolorado")) 1.0 iex> Akin.Metaphone.compare(Akin.Util.compose("Moose"), Akin.Util.compose("Elk")) 0.0