Class PatternManager
- java.lang.Object
-
- org.opensextant.extractors.flexpat.RegexPatternManager
-
- org.opensextant.extractors.xtemporal.PatternManager
-
public class PatternManager extends RegexPatternManager
- Author:
- ubaldino
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.Integer,java.lang.Boolean>
pattern_family_state
-
Fields inherited from class org.opensextant.extractors.flexpat.RegexPatternManager
debug, log, patternFile, patterns, patterns_list, testcases, testing
-
-
Constructor Summary
Constructors Constructor Description PatternManager(java.io.InputStream s, java.lang.String n)
Pass in InputStream to provide yourself the most flexibility.
-
Method Summary
Modifier and Type Method Description protected RegexPattern
create_pattern(java.lang.String fam, java.lang.String rule, java.lang.String desc)
Implementation must create a RegexPattern given the basic RULE define, #RULE FAMILY RID REGEX PatternManager here adds compiled pattern and DEFINES.protected PatternTestCase
create_testcase(java.lang.String id, java.lang.String fam, java.lang.String text)
Implementation must create TestCases given the #TEST directive, #TEST RID TID TEXTvoid
enable_pattern(RegexPattern repat)
enable an instance of a pattern based on the global settings.void
enable_pattern_family(int fam, boolean enabled)
void
initialize(java.io.InputStream io)
Initializes the pattern manager implementations.protected boolean
validate_pattern(RegexPattern pat)
Implementation has the option to check a pattern; For now invalid patterns are only logged.-
Methods inherited from class org.opensextant.extractors.flexpat.RegexPatternManager
disableAll, enable_patterns, enableAll, get_pattern, get_patterns, getConfigurationDebug, group_map, group_matches
-
-
-
-
Method Detail
-
initialize
public void initialize(java.io.InputStream io) throws java.io.IOException
Description copied from class:RegexPatternManager
Initializes the pattern manager implementations. Reads the DEFINEs and RULEs from the pattern file and does the requisite substitutions. After initialization patterns HashMap will be populated.- Overrides:
initialize
in classRegexPatternManager
- Parameters:
io
- stream- Throws:
java.io.IOException
-
create_pattern
protected RegexPattern create_pattern(java.lang.String fam, java.lang.String rule, java.lang.String desc)
Description copied from class:RegexPatternManager
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 classRegexPatternManager
- Parameters:
fam
-rule
-desc
-- Returns:
-
validate_pattern
protected boolean validate_pattern(RegexPattern pat)
Description copied from class:RegexPatternManager
Implementation has the option to check a pattern; For now invalid patterns are only logged.- Specified by:
validate_pattern
in classRegexPatternManager
- Parameters:
pat
-- Returns:
-
create_testcase
protected PatternTestCase create_testcase(java.lang.String id, java.lang.String fam, java.lang.String text)
Description copied from class:RegexPatternManager
Implementation must create TestCases given the #TEST directive, #TEST RID TID TEXT- Specified by:
create_testcase
in classRegexPatternManager
- Parameters:
id
-fam
-text
-- Returns:
-
enable_pattern
public void enable_pattern(RegexPattern repat)
enable an instance of a pattern based on the global settings.- Specified by:
enable_pattern
in classRegexPatternManager
- Parameters:
repat
-
-
enable_pattern_family
public void enable_pattern_family(int fam, boolean enabled)
- Parameters:
fam
-enabled
-
-
-