TheFuzz.Util (TheFuzz v0.6.0)
View SourceUtilities for TheFuzz.
Summary
Functions
Removes duplicates from a string (except for c)
Finds the intersection of two lists. If Strings are provided, it uses the codepoints of said string.
Checks to see if a string is alphabetic.
Finds the length of a string in a less verbose way.
ngram tokenizes the string provided.
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(~c"context", ~c"contentcontent")
~c"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"]