Class PoliPatternManager

java.lang.Object
org.opensextant.extractors.flexpat.RegexPatternManager
org.opensextant.extractors.poli.PoliPatternManager

public final class PoliPatternManager extends RegexPatternManager
  • Constructor Details

  • Method Details

    • disable_patterns

      public void disable_patterns(String fam)
      Enable a family of patterns
      Parameters:
      fam - pat family to disable
    • enableAll

      public void enableAll()
      You don't really want to enable All patterns... unless you are brute force testing all your patterns.
      Overrides:
      enableAll in class RegexPatternManager
    • enable_patterns

      public void enable_patterns(String fam)
      Description copied from class: RegexPatternManager
      default adapter -- you must override. This should be abstract, but not all pattern managers are required to support this.
      Overrides:
      enable_patterns in class RegexPatternManager
      Parameters:
      fam - pattern name to enable.
    • enable_pattern

      public void enable_pattern(RegexPattern repat)
      enable an instance of a pattern based on the global settings.
      Specified by:
      enable_pattern in class RegexPatternManager
      Parameters:
      repat - regex pattern
    • create_pattern

      protected RegexPattern create_pattern(String fam, String rule, String desc)
      Pattern Factory Implementation must create a RegexPattern given the basic RULE define, #RULE FAMILY RID REGEX PatternManager here adds compiled pattern and DEFINES.
      Specified by:
      create_pattern in class RegexPatternManager
      Parameters:
      fam - pattern family
      rule - pattern rule ID
      desc - optional description
      Returns:
      flexpat pattern
    • validate_pattern

      protected boolean validate_pattern(RegexPattern repat)
      Implementation has the option to check a pattern; For now invalid patterns are only logged. All patterns in config file are valid. Override this as needed.
      Specified by:
      validate_pattern in class RegexPatternManager
      Parameters:
      repat - pattern object
      Returns:
      true if pattern is valid
    • create_testcase

      protected PatternTestCase create_testcase(String id, String fam, String text)
      Implementation must create TestCases given the #TEST directive, #TEST RID TID TEXT
      Specified by:
      create_testcase in class RegexPatternManager
      Parameters:
      id - test ID
      text - text for test
      fam - pattern family to test
      Returns:
      test case
    • create_match

      @Deprecated public PoliMatch create_match(String pattern_id, String matchtext, Map<String,String> groups)
      Deprecated.
      logic for creation of a match is back in main PoLi match loop
      The match object is normalized, setting the coord_text and other data from parsing "text" and knowing which pattern family was matched.
      Parameters:
      pattern_id - the pattern_id
      matchtext - the matchtext
      groups - the groups
      Returns:
      the poli match