Package net.loomchild.segment.srx
Class RuleManager
- java.lang.Object
-
- net.loomchild.segment.srx.RuleManager
-
public class RuleManager extends Object
Represents segmentation rules manager. Responsible for constructing and storing break and exception rules.- Author:
- loomchild
-
-
Constructor Summary
Constructors Constructor Description RuleManager(SrxDocument document, List<LanguageRule> languageRuleList, int maxLookbehindConstructLength)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Rule>
getBreakRuleList()
Pattern
getExceptionPattern(Rule breakRule)
-
-
-
Constructor Detail
-
RuleManager
public RuleManager(SrxDocument document, List<LanguageRule> languageRuleList, int maxLookbehindConstructLength)
Constructor. Responsible for retrieving rules from SRX document for given language code, constructing patterns and storing them in quick accessible format. Adds break rules tobreakRuleList
and constructs corresponding exception patterns inexceptionPatternMap
. Uses document cache to store rules and patterns.- Parameters:
document
- SRX documentlanguageRuleList
- list of language rulesmaxLookbehindConstructLength
- Maximum length of regular expression in lookbehind (seeUtil.finitize(String, int)
).
-
-