TheFuzz v0.5.0 TheFuzz.Util View Source
Utilities for TheFuzz.
Link to this section Summary
Functions
Removes duplicates from a string (except for c)
Example
iex> TheFuzz.Util.deduplicate("buzz")
"buz"
iex> TheFuzz.Util.deduplicate("accept")
"accept"
Finds the intersection of two lists. If Strings are provided, it uses the codepoints of said string.
Example
iex> TheFuzz.Util.intersect('context', 'contentcontent')
'contet'
iex> TheFuzz.Util.intersect("context", "contentcontent")
["c", "o", "n", "t", "e", "t"]
Checks to see if a string is alphabetic.
Example
iex> TheFuzz.Util.is_alphabetic?("Jason5")
false
iex> TheFuzz.Util.is_alphabetic?("Jason")
true
Finds the length of a string in a less verbose way.
Example
iex> TheFuzz.Util.len("Jason")
5
ngram tokenizes the string provided.
Example
iex> TheFuzz.Util.ngram_tokenize("abcdefghijklmnopqrstuvwxyz", 2)
["ab", "bc", "cd", "de", "ef", "fg", "gh", "hi", "ij", "jk", "kl", "lm",
"mn", "no", "op", "pq", "qr", "rs", "st", "tu", "uv", "vw", "wx", "xy",
"yz"]
Link to this section Functions
Link to this function
deduplicate(value) View Source
Removes duplicates from a string (except for c)
Example
iex> TheFuzz.Util.deduplicate("buzz")
"buz"
iex> TheFuzz.Util.deduplicate("accept")
"accept"
Link to this function
intersect(l1, l2) View Source
Finds the intersection of two lists. If Strings are provided, it uses the codepoints of said string.
Example
iex> TheFuzz.Util.intersect('context', 'contentcontent')
'contet'
iex> TheFuzz.Util.intersect("context", "contentcontent")
["c", "o", "n", "t", "e", "t"]
Link to this function
is_alphabetic?(value) View Source
Checks to see if a string is alphabetic.
Example
iex> TheFuzz.Util.is_alphabetic?("Jason5")
false
iex> TheFuzz.Util.is_alphabetic?("Jason")
true
Link to this function
len(value) View Source
Finds the length of a string in a less verbose way.
Example
iex> TheFuzz.Util.len("Jason")
5
Link to this function
ngram_tokenize(string, n) View Source
ngram tokenizes the string provided.
Example
iex> TheFuzz.Util.ngram_tokenize("abcdefghijklmnopqrstuvwxyz", 2)
["ab", "bc", "cd", "de", "ef", "fg", "gh", "hi", "ij", "jk", "kl", "lm",
"mn", "no", "op", "pq", "qr", "rs", "st", "tu", "uv", "vw", "wx", "xy",
"yz"]