Class MailAddressScan

java.lang.Object
opennlp.tools.util.normalizer.MailAddressScan

@Internal public final class MailAddressScan extends Object
Finds email addresses in text for UrlCharSequenceNormalizer and classifies whole tokens as email addresses. An address is a maximal run of the local-part set [-+_.0-9A-Za-z] with a left neighbor outside that set, an @, and a domain run out of [-.0-9A-Za-z] that does not start with a dot and spans at least two chars.
  • Method Details

    • isAddress

      public static boolean isAddress(CharSequence text)
      Checks whether a whole text is one email address.
      Parameters:
      text - The text to classify. Must not be null.
      Returns:
      true if an address starts at index 0 and ends at the end of text, false otherwise, also for the empty text.
      Throws:
      IllegalArgumentException - Thrown if text is null.