Package org.opensextant.extractors.poli
Class PatternsOfLife
java.lang.Object
org.opensextant.extractors.flexpat.AbstractFlexPat
org.opensextant.extractors.poli.PatternsOfLife
- All Implemented Interfaces:
Extractor
- Author:
- Marc C. Ubaldino, MITRE, ubaldino at mitre dot org
-
Field Summary
Fields inherited from class org.opensextant.extractors.flexpat.AbstractFlexPat
debug, log, match_width, patterns, patterns_file
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected RegexPatternManager
Create a pattern manager given the input stream and the file name.Useful for working with text buffers adhoc.Support the standard Extractor interface.extract_patterns
(String text, String text_id, String family) Extract patterns of a certain family from a block of text.getName()
Extractor interface: getNameMethods inherited from class org.opensextant.extractors.flexpat.AbstractFlexPat
cleanup, configure, configure, configure, configure, disableAll, enableAll, getPatternManager, set_match_id, setMatchWidth
-
Field Details
-
DEFAULT_POLI_CFG
- See Also:
-
-
Constructor Details
-
PatternsOfLife
public PatternsOfLife(boolean debugmode) -
PatternsOfLife
public PatternsOfLife()Default constructor, debugging off.
-
-
Method Details
-
getName
Extractor interface: getName- Returns:
- extractor name
-
createPatternManager
Description copied from class:AbstractFlexPat
Create a pattern manager given the input stream and the file name.- Specified by:
createPatternManager
in classAbstractFlexPat
- Parameters:
s
- stream of patterns config filen
- app name- Returns:
- the regex pattern manager
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
extract
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
-
extract
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
Extract patterns of a certain family from a block of text.- Parameters:
text
- - data to processtext_id
- - identifier for the datafamily
- - optional filter; to reuse the same PatManager but extract certain patterns only.- Returns:
- PoliResult
-