Class PatternsOfLife

java.lang.Object
org.opensextant.extractors.flexpat.AbstractFlexPat
org.opensextant.extractors.poli.PatternsOfLife
All Implemented Interfaces:
Extractor

public class PatternsOfLife extends AbstractFlexPat
Author:
Marc C. Ubaldino, MITRE, ubaldino at mitre dot org
  • Field Details

  • Constructor Details

    • PatternsOfLife

      public PatternsOfLife(boolean debugmode)
    • PatternsOfLife

      public PatternsOfLife()
      Default constructor, debugging off.
  • Method Details

    • getName

      public String getName()
      Extractor interface: getName
      Returns:
      extractor name
    • createPatternManager

      protected RegexPatternManager createPatternManager(InputStream s, String n) throws IOException
      Description copied from class: AbstractFlexPat
      Create a pattern manager given the input stream and the file name.
      Specified by:
      createPatternManager in class AbstractFlexPat
      Parameters:
      s - stream of patterns config file
      n - app name
      Returns:
      the regex pattern manager
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • extract

      public List<TextMatch> extract(TextInput input)
      Support the standard Extractor interface. This provides access to the most common extraction; For PoLi extraction, you would process ALL patterns in your configuration file, or if you enable only certain patterns -- those enabled at the time of this call would be executed. extract_patterns( family = null ) implies ALL patterns.
      Parameters:
      input - text input
      Returns:
      the list of TextMatch
    • extract

      public List<TextMatch> extract(TextInput input, String family)
    • extract

      public List<TextMatch> extract(String input_buf)
      Description copied from interface: Extractor
      Useful for working with text buffers adhoc. Fewer assumptions about input data here.
      Parameters:
      input_buf - text input, as a string
      Returns:
      the list of TextMatch
    • extract_patterns

      public TextMatchResult extract_patterns(String text, String text_id, String family)
      Extract patterns of a certain family from a block of text.
      Parameters:
      text - - data to process
      text_id - - identifier for the data
      family - - optional filter; to reuse the same PatManager but extract certain patterns only.
      Returns:
      PoliResult