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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindSimilar(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, int maxSize) Suggest a list of matches.findTaxa(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, int maxSize) Suggest a list of matches.getSpeciesAuthority(String genus, String species) Return species authority for the genus + species.getSpeciesAuthority(String genus, String species, String spAuthor) Return species authority for the genus + species.getSubtaxaAuthority(String genus, String species, String spAuthor, String subtaxa, String subtAuthor) Return authority for the genus + species + subtaxaGet exact match.voidsetTaxonomyDatabase(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.suggestSpecies(String genus, String species, String spAuthor, int maxSize) Find suggestions for SPECIES.suggestSubtaxa(String genus, String species, String subtaxa, int maxSize) Find suggestions for SUBTAXA.suggestSubtaxa(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, 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.
-
suggestSpecies
Find suggestions for SPECIES.- Parameters:
genus- the genusspecies- the speciesspAuthor- species authoritymaxSize- 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
-
getSpeciesAuthority
Return species authority for the genus + species.- Parameters:
genus- the genusspecies- the speciesspAuthor- species authority- 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.
-
suggestSubtaxa
public List<String> suggestSubtaxa(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, int maxSize) Find suggestions for SUBTAXA.- Parameters:
genus- must be valid genus in the databasespecies- species must be valid species within genusspAuthor- species authoritysubtaxa- current subtaxa, must not be null or blanksubtAuthor- species authority at the lowest classification levelmaxSize- maximum number of suggestions to return- Returns:
- suggested fixes for subtaxa or empty list if there are no suggestions.
-
getSubtaxaAuthority
public List<String> getSubtaxaAuthority(String genus, String species, String spAuthor, String subtaxa, String subtAuthor) Return authority for the genus + species + subtaxa- Parameters:
genus- the genusspecies- the speciesspAuthor- species authoritysubtaxa- subtaxa to checksubtAuthor- species authority at the lowest classification level- Returns:
- species authority if there's one matching record in the database
-
findTaxa
@Nonnull public List<TaxonomyChecker.Taxon> findTaxa(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, int maxSize) Suggest a list of matches.- Parameters:
genus- valid genusspecies- valid speciesspAuthor- species authoritysubtaxa- subtaxa to checksubtAuthor- species authority at the lowest classification levelmaxSize- maximum number of suggestions to return- Returns:
- list of suggestions, ordered by preference, never null
- Since:
- 3.10
-
getTaxon
public TaxonomyChecker.Taxon getTaxon(String genus, String species, String spAuthor, String subtaxa, String subtAuthor) Get exact match.- Parameters:
genus- valid genusspecies- valid speciesspAuthor- species authoritysubtaxa- subtaxa to checksubtAuthor- species authority at the lowest classification level- Returns:
- One exactly matching record
- Since:
- 3.10
-
findSimilar
@Nonnull public List<TaxonomyChecker.Taxon> findSimilar(String genus, String species, String spAuthor, String subtaxa, String subtAuthor, int maxSize) Suggest a list of matches.- Parameters:
genus- valid genusspecies- valid speciesspAuthor- species authoritysubtaxa- subtaxa to checksubtAuthor- species authority at the lowest classification levelmaxSize- maximum number of suggestions to return- Returns:
- list of suggestions, ordered by preference, never null
- Since:
- 3.10
-
similarityScore
Get string similarity score.- Parameters:
string1- string Astring2- string B- Returns:
- the double
-