Akin (Akin v0.1.5) View Source
Compare two strings for similarity. Options accepted in a keyword list (i.e. [ngram_size: 3]).
algorithms
: algorithms to use in comparision. Accepts the name or a keyword list. Default is algorithms/0.metric
- algorithm metric. Default is both
- "string": uses string algorithms
- "phonetic": uses phonetic algorithms
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)
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
match_at
: an algorith score equal to or above this value is condsidered a match. Default is 0.9ngram_size
: number of contiguous letters to split strings into. Default is 2.short_length
: qualifies as "short" to recieve a shortness boost. Used by Name Metric. Default is 8.stem
: boolean representing whether to compare the stemmed version the strings; uses Stemmer. Defaultfalse
Link to this section Summary
Functions
List of algorithms available for us in making comparisons.
Compare two strings. Return map of algorithm metrics.
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.
compare(left, right, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])
View SourceSpecs
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.
compare_using(algorithm, left, right, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])
View SourceSpecs
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
match_name_metrics(left, rights, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])
View SourceSpecs
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.
match_names(left, rights, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])
View SourceSpecs
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.
match_names_metrics(left, rights, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])
View SourceSpecs
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
Compare two strings. Return only the highest algorithm metrics. Options accepted as a keyword list.
max(left, right, opts \\ [ngram_size: 2, level: "normal", short_length: 8, match_at: 0.9])
View SourceSpecs
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.