View Source Akin.Util (Akin v0.2.0)
Utilities for string preparation, manipulation, comparison, and inspection.
Summary
Functions
Convert string to downcase and unicode standard, standardize whitespace, replace nontext (like emojis), replace punctuation, and convert accents. Then compose a string into a corpus of values for disambiguation. Returns nil when given non-binary. )
Removes duplicates from a string (except for c and the final letter). Used in metaphone algorithm.
Return the default option values
Compares two values for equality
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.
Return the length of a string.
Return a list of algorithms.
Camelize input and return as an existing atom, as in referencing functions through apply
Tokenizes the input into N-grams (http://en.wikipedia.org/wiki/N-gram).
Take the value for the key from the options. If not present, use the default value from the default options list.
Round data types that can be rounded to 2 decimal points.
If the conditions are met, replace character with white space. The right condition is when either but noth both the left or right strings contains the character.
Functions
Convert string to downcase and unicode standard, standardize whitespace, replace nontext (like emojis), replace punctuation, and convert accents. Then compose a string into a corpus of values for disambiguation. Returns nil when given non-binary. )
Removes duplicates from a string (except for c and the final letter). Used in metaphone algorithm.
Return the default option values
Compares two values for equality
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.
Return the length of a string.
Return a list of algorithms.
Accepts a list of algorithm names or a keyword list of options. Default returns all available.
Options | Default | ||
---|---|---|---|
metric | "string" | "phonetic" | both |
unit | "whole" | "partial" | both |
Camelize input and return as an existing atom, as in referencing functions through apply
Tokenizes the input into N-grams (http://en.wikipedia.org/wiki/N-gram).
Take the value for the key from the options. If not present, use the default value from the default options list.
Round data types that can be rounded to 2 decimal points.
If the conditions are met, replace character with white space. The right condition is when either but noth both the left or right strings contains the character.
Accepts a left string and a right string or a right list of strings and list of characters to replace. Returns a tuple containing left and right with replacements, if replacements were made. Otherwise, the tuple contains the original strings.