Class FullTextMatcher

All Implemented Interfaces:
IHeaderMatcher

public class FullTextMatcher extends SimpleTextMatcher
Accumulates all letters and numbers contained inside the header and compares it to the full text of a given license (after reducing it to letters and numbers as well).

The text comparison is case insensitive but assumes only characters in the US-ASCII charset are being matched.

  • Constructor Details

    • FullTextMatcher

      public FullTextMatcher(String simpleText)
      Constructs the full text matcher with a unique random id and the specified text to match.
      Parameters:
      simpleText - the text to match
    • FullTextMatcher

      public FullTextMatcher(String id, String simpleText)
      Constructs the full text matcher for the specified text.
      Parameters:
      id - the id for the matcher
      simpleText - the text to match
  • Method Details

    • prune

      public static String prune(String text)
      Removes everything except letter or digit from text.
      Parameters:
      text - The text to remove extra chars from.
      Returns:
      the pruned text.
    • matches

      public boolean matches(IHeaders headers)
      Description copied from interface: IHeaderMatcher
      Attempts to match text in the IHeaders instance.
      Specified by:
      matches in interface IHeaderMatcher
      Overrides:
      matches in class SimpleTextMatcher
      Parameters:
      headers - the representations of the headers to check
      Returns:
      true if the matcher matches the text, false otherwise.