Closed josephwb closed 10 years ago
This should be working on devapi (ot10)
curl -X POST http://devapi.opentreeoflife.org/taxomachine/v1/contextQueryForNames -H "content-type:application/json" -d '{"queryString":"Sarcophaga jonesii","contextName":"All life"}'
[clipped]
{
"is_deprecated" : false,
"dubious_name" : false,
"is_synonym" : true,
"flags" : [ ],
"search_string" : "sarcophaga jonesii",
"score" : 0.8823529411764706,
"is_approximate_match" : true,
"ot:ottId" : 4370895,
"matched_node_id" : 1774980,
"rank" : "",
"matched_name" : "Sarcophaga jonesi",
"unique_name" : "Fletcherimyia jonesi",
"nomenclature_code" : "ICZN",
"ot:ottTaxonName" : "Fletcherimyia jonesi"
}
[clipped]
As it stands, the reported
score
of a query synonym name is calculated against the valid taxon name, not the synonym name in the DB. An example we are working with is "Sarcophaga jonesi", which is a synonym for "Fletcherimyia jonesi". When querying a typo of the synonym, "Sarcophaga jonesii", the following is returned (pruned here):The typo query "Sarcophaga jonesii" has a Levenshtein distance of 1 from the synonym "Sarcophaga jonesi", which is probably what the reported score should be based upon, not the Levenshtein distance of 12 between the query "Sarcophaga jonesii" and the valid taxon "Fletcherimyia jonesi".