Interface NameParser


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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ParsedName parse​(String scientificName)
      Delegate method to parse a scientific name of unknown rank.
      ParsedName 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.
      ParsedName parseQuietly​(String scientificName)
      Delegate method to parse a scientific name of unknown rank quietly.
      ParsedName 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.
      String parseToCanonical​(String scientificName)
      Delegate method to parse a scientific name of unknown rank and return its canonical form.
      String parseToCanonical​(String scientificName, Rank rank)
      Parses the scientific name without authorship and returns the ParsedName.canonicalName() string
    • Method Detail

      • 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
      • 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.