Package org.genesys.taxonomy.checker
Class TaxonomyChecker
- java.lang.Object
-
- org.genesys.taxonomy.checker.TaxonomyChecker
-
public class TaxonomyChecker extends Object
Suggest fixes to scientific names based on an in-memory list of valid taxonomies.
-
-
Constructor Summary
Constructors Constructor Description TaxonomyChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetSpeciesAuthority(String genus, String species)Return species authority for the genus + species.StringgetSubtaxaAuthority(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.List<String>suggestGenus(String genus, int maxSize)Find suggestions for GENUS.List<String>suggestSpecies(String genus, String species, int maxSize)Find suggestions for SPECIES.List<String>suggestSubtaxa(String genus, String species, String subtaxa, int maxSize)Find suggestions for SUBTAXA.
-
-
-
Method Detail
-
setTaxonomyDatabase
public void setTaxonomyDatabase(TaxonomyDatabase database)
Sets the taxonomy database.- Parameters:
database- the new taxonomy database
-
suggestGenus
public List<String> suggestGenus(String genus, int maxSize)
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
public List<String> suggestSpecies(String genus, String species, int maxSize)
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
public String getSpeciesAuthority(String genus, String species)
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
public List<String> suggestSubtaxa(String genus, String species, String subtaxa, int maxSize)
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
public String getSubtaxaAuthority(String genus, String species, String subtaxa)
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
-
-