View Source Akin.BagDistance (Akin v0.2.0)
Function to calculate the Bag Distance between two strings
Summary
Functions
Callback implementation for Akin.Task.compare/2
.
Calculates the Bag Distance between two given strings
Functions
@spec 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
.
@spec 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