Abstract Rules
Base Pattern
Bases: BaseModel
, abc.ABC
Source code in statute_patterns/components/rule.py
Attributes
group_name: str
abstractmethod
property
Added to regex string to identify the match.lastgroup
pattern: Pattern
property
Enables use of a unique Pattern object per rule pattern created, regardless of it being a SerialPattern or a NamedPattern.
regex: str
abstractmethod
property
Combines the group_name with the desired regex string.
Base Collection
Bases: BaseModel
, abc.ABC
Whether a collection of Named or Serial patterns are instantiated,
a combined_regex
property and a pattern
propery will be automatically
created based on the collection of objects declared on instantiation
of the class.
Source code in statute_patterns/components/rule.py
Attributes
combined_regex: str
property
Combine the different items in the collection (having .regex attribute) to form a single regex string.