Package org.genesys.taxonomy.checker
Class TaxonomyChecker
java.lang.Object
org.genesys.taxonomy.checker.TaxonomyChecker
Suggest fixes to scientific names based on an in-memory list of valid taxonomies.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSpeciesAuthority(String genus, String species) Return species authority for the genus + species.getSubtaxaAuthority(String genus, String species, String subtaxa) Return authority for the genus + species + subtaxavoidsetTaxonomyDatabase(TaxonomyDatabase database) Sets the taxonomy database.doublesimilarityScore(String string1, String string2) Get string similarity score.suggestGenus(String genus, int maxSize) Find suggestions for GENUS.suggestSpecies(String genus, String species, int maxSize) Find suggestions for SPECIES.suggestSubtaxa(String genus, String species, String subtaxa, int maxSize) Find suggestions for SUBTAXA.
-
Constructor Details
-
TaxonomyChecker
public TaxonomyChecker()
-
-
Method Details
-
setTaxonomyDatabase
Sets the taxonomy database.- Parameters:
database- the new taxonomy database
-
suggestGenus
Find suggestions for GENUS.- Parameters:
genus- the genusmaxSize- the max size- Returns:
- suggested fixes for genus or empty list when genus is fine or when there are no suggestions.
-
suggestSpecies
Find suggestions for SPECIES.- Parameters:
genus- the genusspecies- the speciesmaxSize- maximum number of suggestions to return- Returns:
- suggested fixes for genus or empty list if species is fine or when there are no suggestions.
-
getSpeciesAuthority
Return species authority for the genus + species.- Parameters:
genus- the genusspecies- the species- Returns:
- species authority if there's one matching record in the database
-
suggestSubtaxa
Find suggestions for SUBTAXA.- Parameters:
genus- must be valid genus in the databasespecies- species must be valid species within genussubtaxa- current subtaxa, must not be null or blankmaxSize- maximum number of suggestions to return- Returns:
- suggested fixes for subtaxa or empty list if there are no suggestions.
-
getSubtaxaAuthority
Return authority for the genus + species + subtaxa- Parameters:
genus- the genusspecies- the speciessubtaxa- subtaxa- Returns:
- species authority if there's one matching record in the database
-
similarityScore
Get string similarity score.- Parameters:
string1- string Astring2- string B- Returns:
- the double
-