Akin.BagDistance (Akin v0.1.6) View Source

Function to calculate the Bag Distance between two strings

Link to this section Summary

Functions

Callback implementation for Akin.Task.compare/2.

Calculates the Bag Distance between two given strings

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()

Calculates the Bag Distance between two given strings

Examples

iex> Akin.BagDistance.compare(%Akin.Corpus{string: "contact"}, %Akin.Corpus{string: "context"}) 0.7142857142857143