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 Details

    • TaxonomyChecker

      public TaxonomyChecker()
  • Method Details

    • 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 genus
      maxSize - 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 genus
      species - the species
      maxSize - 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 genus
      species - 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 database
      species - species must be valid species within genus
      subtaxa - current subtaxa, must not be null or blank
      maxSize - 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 genus
      species - the species
      subtaxa - subtaxa
      Returns:
      species authority if there's one matching record in the database
    • similarityScore

      public double similarityScore(String string1, String string2)
      Get string similarity score.
      Parameters:
      string1 - string A
      string2 - string B
      Returns:
      the double