public class CoreNlpUtilities extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CRLF
Platform independent newline String.
|
Modifier and Type | Method and Description |
---|---|
static String |
generateCoreNlpRegexRuleFileContent(String ruleType,
String pattern,
String action,
String result)
Generates the content that reflects the specifeid Regex rule, to be used
as the file content used to test legality of the rule specification.
|
static boolean |
isLegalCoreNlpRegexRule(CoreNlpRegexRule rule)
Tests the specified CoreNlpRegexRule and returns
indication of whether or not it is legally defined.
|
static boolean |
isLegalCoreNlpRegexRule(String pattern,
String action,
String result)
Tests the specified components of a CoreNlpRegexRule and returns
indication of whether they constitute a legal rule.
|
static boolean |
isLegalRegexPattern(InformationExtractionRegexPattern pattern)
Tests the specified InformationExtractionRegexPattern and returns
indication of whether or not it is legally defined.
|
static boolean |
isLegalRegexPattern(String patternStr)
Tests the specified pattern intended to be used in a
InformationExtractionRegexPattern, and returns
indication of whether it constitutes a legal pattern.
|
public static final String CRLF
public static boolean isLegalRegexPattern(InformationExtractionRegexPattern pattern) throws IfsException
Delegates to a second variant that takes the actual pattern of the RegexPattern.
pattern
- the InformationExtractionRegexPatternIfsException
- if the operation failspublic static boolean isLegalRegexPattern(String patternStr)
patternStr
- the REGEX pattern; cannot be nullpublic static boolean isLegalCoreNlpRegexRule(CoreNlpRegexRule rule) throws IfsException
Delegates to a second variant that takes the individual components of the RegexRule.
rule
- the CoreNlpRegexRuleIfsException
- if the operation failspublic static boolean isLegalCoreNlpRegexRule(String pattern, String action, String result)
pattern
- the REGEX pattern; cannot be nullaction
- the action to perform; can be nullresult
- the result of a matched expression; can be nullpublic static String generateCoreNlpRegexRuleFileContent(String ruleType, String pattern, String action, String result)
ruleType
- the rule type; currently this must be "tokens",
as this is the only rule type supportedpattern
- the REGEX pattern; cannot be nullaction
- the action to perform; can be nullresult
- the result of a matched expression; can be nullCopyright © 2023. All rights reserved.