A library to do 'fuzzy' matches. It looks for the similarity between two strings or searches for the best match of a string in a table of strings.
More information on the algorithms can be found at Algorithms
Implemented algorithms:
CHAPMAN_MATCHING_SOUNDEX
CHAPMAN_MEAN_LENGTH
CHAPMAN_ORDERED_NAME_COMPOUND_SIMILARITY
JARO
JARO_WINKLER
LEVENSHTEIN_DISTANCE
MONGE_ELKAN
NEEDLEMAN_WUNCH
QGRAMS_DISTANCE
SMITH_WATERMAN
SMITH_WATERMAN_GOTOH
SMITH_WATERMAN_GOTOH_WINDOWED_AFFINE
SOUNDEX
TAGLINK
TAGLINK_TOKEN
Functions
ABFindBestMatchAll(myList, SearchTerm) as ABFoundMatch
Finds the best match of a string in a table of strings using all available algorithms.
Returns an ABFoundMatch object
Example:
ABFindBestMatch(myList, SearchTerm, algorithm) AS ABFoundMatch
Finds the best match of a string in a table of strings using a specific algorithm.
Returns an ABFoundMatch object
Example:
ABGetSimilarity(string1, string2, algorithm) AS float
gives the percentage a string matches with another string using a specific algorithm.
Returns a float (percentage)
Example:
ABFoundMatch Object
Properties:
Percentage as int
FoundString as String
UsedAlgorithm as int
UsedAlgorithmName as String
More information on the algorithms can be found at Algorithms
Implemented algorithms:
CHAPMAN_MATCHING_SOUNDEX
CHAPMAN_MEAN_LENGTH
CHAPMAN_ORDERED_NAME_COMPOUND_SIMILARITY
JARO
JARO_WINKLER
LEVENSHTEIN_DISTANCE
MONGE_ELKAN
NEEDLEMAN_WUNCH
QGRAMS_DISTANCE
SMITH_WATERMAN
SMITH_WATERMAN_GOTOH
SMITH_WATERMAN_GOTOH_WINDOWED_AFFINE
SOUNDEX
TAGLINK
TAGLINK_TOKEN
Functions
ABFindBestMatchAll(myList, SearchTerm) as ABFoundMatch
Finds the best match of a string in a table of strings using all available algorithms.
Returns an ABFoundMatch object
Example:
B4X:
Dim sim as ABSimMetrics
Dim mat as ABFoundMatch
Dim mylist(3) as String
mylist(0) = "Alain"
mylist(1) = "Aldo"
mylist(2) = "Albrecht"
mat = sim.ABFindBestMatchAll(myList, "Albert")
msgbox (mat.FoundString, "")
ABFindBestMatch(myList, SearchTerm, algorithm) AS ABFoundMatch
Finds the best match of a string in a table of strings using a specific algorithm.
Returns an ABFoundMatch object
Example:
B4X:
Dim sim as ABSimMetrics
Dim mat as ABFoundMatch
Dim mylist(3) as String
mylist(0) = "Alain"
mylist(1) = "Aldo"
mylist(2) = "Albrecht"
mat = sim.ABFindBestMatch(myList, "Albert", sim.LEVENSHTEIN_DISTANCE)
msgbox (mat.FoundString, "")
ABGetSimilarity(string1, string2, algorithm) AS float
gives the percentage a string matches with another string using a specific algorithm.
Returns a float (percentage)
Example:
B4X:
dim sim as ABSimMetrics
dim perc as float
perc = sim.ABGetSimilarity("Albrecht", "Albert", sim.LEVENSHTEIN_DISTANCE)
msgbox (perc, "")
ABFoundMatch Object
Properties:
Percentage as int
FoundString as String
UsedAlgorithm as int
UsedAlgorithmName as String
Attachments
Last edited: