Class PatternManager
java.lang.Object
org.opensextant.extractors.flexpat.RegexPatternManager
org.opensextant.extractors.xtemporal.PatternManager
- Author:
- ubaldino
-
Field Summary
Fields inherited from class org.opensextant.extractors.flexpat.RegexPatternManager
debug, log, patternFile, patterns, patterns_list, testcases, testing
-
Constructor Summary
ConstructorDescriptionPatternManager
(InputStream s, String n) Pass in InputStream to provide yourself the most flexibility. -
Method Summary
Modifier and TypeMethodDescriptionprotected RegexPattern
create_pattern
(String fam, String rule, 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
(String id, String fam, 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
Initializes the pattern manager implementations.protected boolean
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
-
Field Details
-
pattern_family_state
-
-
Constructor Details
-
PatternManager
Pass in InputStream to provide yourself the most flexibility.- Parameters:
s
- io streamn
- name of patterns file- Throws:
IOException
-
-
Method Details
-
initialize
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:
IOException
-
create_pattern
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
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
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
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
-
-