Difference between revisions of "Taxamatch Algorithm"

From D4Science Wiki
Jump to: navigation, search
(Algorithm)
Line 1: Line 1:
 
== Defining of Terms ==
 
== Defining of Terms ==
Taxamatch is  
+
;Phonetic
 +
:compare pronunciation similarity of input and data. 1 being the highest
 +
;MDLD
 +
:the Modified Damerau-Levenshtein Distance test
 +
:the minimal number of characters you have to replace, insert, or delete to make two strings similar. If MDLD is equals to 0, it means the two strings are the same
 +
;Similarity
 +
:returns percentage similarity of input and data
  
 
== Algorithm ==
 
== Algorithm ==
Line 18: Line 24:
 
# Run last search without any filter of genus and species
 
# Run last search without any filter of genus and species
 
# Filter the output using the functions: phonetic, mdld, and similarity.
 
# Filter the output using the functions: phonetic, mdld, and similarity.
 
;Phonetic
 
:compare pronunciation similarity of input and data. 1 being the highest
 
;MDLD
 
:the Modified Damerau-Levenshtein Distance test
 
:the minimal number of characters you have to replace, insert, or delete to make two strings similar. If MDLD is equals to 0, it means the two strings are the same
 
;Similarity
 
:returns percentage similarity of input and data
 
 
      
 
      
 
It prints the species if it satisfy all the conditions below:
 
It prints the species if it satisfy all the conditions below:

Revision as of 07:31, 14 November 2012

Defining of Terms

Phonetic
compare pronunciation similarity of input and data. 1 being the highest
MDLD
the Modified Damerau-Levenshtein Distance test
the minimal number of characters you have to replace, insert, or delete to make two strings similar. If MDLD is equals to 0, it means the two strings are the same
Similarity
returns percentage similarity of input and data

Algorithm

Here is the step by step procedures and cases used in running Taxamatch:

  1. Get the user's input of species. (e.g. Genus, Species or Genus+Species)
  2. Search for the exact match in the database.
    1. If there is an exact match, print that species;
  3. Normalize the user's input:
    1. Transform any accented character to its non accented character.
    2. Strips out any html character and drop any character other than A-Z, a-z and space.
    3. Remove multiple double letters or multiple spaces.
  4. Get the normalized input and search it in the database.
    1. If there is a match, print that species.
  5. Get the root of the normalized input and search it in the database.
    1. If there is a match, print that species.
  6. Run last search without any filter of genus and species
  7. Filter the output using the functions: phonetic, mdld, and similarity.

It prints the species if it satisfy all the conditions below:

  • the input is phonetic match with the data of greater than or equal to 0.4
  • the mdld of input and data is less than or equal to 4
  • the similarity of input and data is:
    • equals to 100%. This is an exact match.
    • between 50% and 100%. This is a near match.