Interface NameParser


public interface NameParser
Interface for parsing scientific names.
  • Method Summary

    Modifier and Type
    Method
    Description
    parse(String scientificName)
    Delegate method to parse a scientific name of unknown rank.
    parse(String scientificName, Rank rank)
    Fully parse the supplied name also trying to extract authorships, a conceptual sec reference, remarks or notes on the nomenclatural status.
    parseQuietly(String scientificName)
    Delegate method to parse a scientific name of unknown rank quietly.
    parseQuietly(String scientificName, Rank rank)
    Fully parses a name using #parse(String, Rank) but converts names that throw a UnparsableException into ParsedName objects with the scientific name, rank and name type given.
    parseToCanonical(String scientificName)
    Delegate method to parse a scientific name of unknown rank and return its canonical form.
    parseToCanonical(String scientificName, Rank rank)
    Parses the scientific name without authorship and returns the ParsedName.canonicalName() string
  • Method Details

    • parse

      ParsedName parse(String scientificName, @Nullable Rank rank) throws UnparsableException
      Fully parse the supplied name also trying to extract authorships, a conceptual sec reference, remarks or notes on the nomenclatural status. In some cases the authorship parsing proves impossible and this nameparser will return null. For strings which are no scientific names and scientific names that cannot be expressed by the ParsedName class the parser will throw an UnparsableException with a given NameType and the original, unparsed name. This is the case for all virus names and proper hybrid formulas, so make sure you catch and process this exception.
      Parameters:
      scientificName - the full scientific name to parse
      rank - the rank of the name if it is known externally. Helps identifying infrageneric names vs bracket authors
      Returns:
      the parsed name
      Throws:
      UnparsableException
    • parse

      ParsedName parse(String scientificName) throws UnparsableException
      Delegate method to parse a scientific name of unknown rank.
      Returns:
      the parsed name
      Throws:
      UnparsableException
    • parseQuietly

      ParsedName parseQuietly(String scientificName, @Nullable Rank rank)
      Fully parses a name using #parse(String, Rank) but converts names that throw a UnparsableException into ParsedName objects with the scientific name, rank and name type given.
      Returns:
      the parsed name
    • parseQuietly

      ParsedName parseQuietly(String scientificName)
      Delegate method to parse a scientific name of unknown rank quietly.
      Returns:
      the parsed name
    • parseToCanonical

      String parseToCanonical(String scientificName, @Nullable Rank rank)
      Parses the scientific name without authorship and returns the ParsedName.canonicalName() string
      Parameters:
      scientificName - the full scientific name to parse
      rank - the rank of the name if it is known externally. Helps identifying infrageneric names vs bracket authors
      Returns:
      the canonical name or null for unparsable names
    • parseToCanonical

      String parseToCanonical(String scientificName)
      Delegate method to parse a scientific name of unknown rank and return its canonical form.