Akin (Akin v0.1.5) View Source

Compare two strings for similarity. Options accepted in a keyword list (i.e. [ngram_size: 3]).

  1. algorithms: algorithms to use in comparision. Accepts the name or a keyword list. Default is algorithms/0.
    1. metric - algorithm metric. Default is both
    • "string": uses string algorithms
    • "phonetic": uses phonetic algorithms
    1. unit - algorithm unit. Default is both.
    • "whole": uses algorithms best suited for whole string comparison (distance)
    • "partial": uses algorithms best suited for partial string comparison (substring)
  2. level - level for double phonetic matching. Default is "normal".
    • "strict": both encodings for each string must match
    • "strong": the primary encoding for each string must match
    • "normal": the primary encoding of one string must match either encoding of other string (default)
    • "weak": either primary or secondary encoding of one string must match one encoding of other string
  3. match_at: an algorith score equal to or above this value is condsidered a match. Default is 0.9
  4. ngram_size: number of contiguous letters to split strings into. Default is 2.
  5. short_length: qualifies as "short" to recieve a shortness boost. Used by Name Metric. Default is 8.
  6. stem: boolean representing whether to compare the stemmed version the strings; uses Stemmer. Default false

Link to this section Summary

Functions

List of algorithms available for us in making comparisons.

Compare two strings using a particular algorithm. Return a map of metrics. The algorithm name must be an atom (i.e. "jaro_winkler").

Return the default option values

Compare a string to a string with logic specific to names. Matches are determined by algorithem metrics equal to or higher than the match_at option. Return a list of strings that are a likely match and their algorithm metrics.

Compare a string against a list of strings. Matches are determined by algorithem metrics equal to or higher than the match_at option. Return a list of strings that are a likely match.

Compare a string against a list of strings. Matches are determined by algorithem metrics equal to or higher than the match_at option. Return a list of strings that are a likely match and their algorithm metrics.

Compare two strings. Return only the highest algorithm metrics. Options accepted as a keyword list.

Returns list of unqieu phonetic representations of a string resulting from the single and double metaphone algorithms.

Round data types that can be rounded to 2 decimal points.

Link to this section Functions

List of algorithms available for us in making comparisons.

Link to this function

compare(left, right, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])

View Source

Specs

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

Compare two strings. Return map of algorithm metrics.

Options accepted as a keyword list. If no options are given, default values will be used.

Link to this function

compare_using(algorithm, left, right, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])

View Source

Specs

compare_using(
  binary(),
  binary()
  | %Akin.Corpus{
      list: term(),
      original: term(),
      set: term(),
      stems: term(),
      string: term()
    },
  binary()
  | %Akin.Corpus{
      list: term(),
      original: term(),
      set: term(),
      stems: term(),
      string: term()
    },
  keyword()
) :: float()

Compare two strings using a particular algorithm. Return a map of metrics. The algorithm name must be an atom (i.e. "jaro_winkler").

Options accepted as a keyword list. If no options are given, the default values will be used.

Return the default option values

Link to this function

match_name_metrics(left, rights, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])

View Source

Specs

match_name_metrics(binary(), binary(), keyword()) :: float()

Compare a string to a string with logic specific to names. Matches are determined by algorithem metrics equal to or higher than the match_at option. Return a list of strings that are a likely match and their algorithm metrics.

Link to this function

match_names(left, rights, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])

View Source

Specs

match_names(
  binary()
  | %Akin.Corpus{
      list: term(),
      original: term(),
      set: term(),
      stems: term(),
      string: term()
    },
  binary()
  | %Akin.Corpus{
      list: term(),
      original: term(),
      set: term(),
      stems: term(),
      string: term()
    },
  keyword()
) :: float()

Compare a string against a list of strings. Matches are determined by algorithem metrics equal to or higher than the match_at option. Return a list of strings that are a likely match.

Link to this function

match_names_metrics(left, rights, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])

View Source

Specs

match_names_metrics(binary(), list(), keyword()) :: float()

Compare a string against a list of strings. Matches are determined by algorithem metrics equal to or higher than the match_at option. Return a list of strings that are a likely match and their algorithm metrics.

Specs

max(map()) :: float()

Compare two strings. Return only the highest algorithm metrics. Options accepted as a keyword list.

Link to this function

max(left, right, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])

View Source

Specs

max(
  binary()
  | %Akin.Corpus{
      list: term(),
      original: term(),
      set: term(),
      stems: term(),
      string: term()
    },
  binary()
  | %Akin.Corpus{
      list: term(),
      original: term(),
      set: term(),
      stems: term(),
      string: term()
    },
  keyword()
) :: list()

Specs

phonemes(
  binary()
  | %Akin.Corpus{
      list: term(),
      original: term(),
      set: term(),
      stems: term(),
      string: term()
    }
) :: list()

Returns list of unqieu phonetic representations of a string resulting from the single and double metaphone algorithms.

Round data types that can be rounded to 2 decimal points.