signoffs.core.signing_order.signoff_pattern#
Signing Order pattern matching language. Defines the pattern for a Signing Order using Signoff Types
Pattern Matching is backed by regex_match backend (currently not replaceable, but that’d be a nice idea :-)
Module Contents#
Classes#
A pattern that matches any one of a set of alternate patterns |
|
A pattern that is complete when pattern has at least some min. number of tokens. Note: match algorithm consumes all consecutive matching tokens (greedy) |
|
A pattern that is complete with exactly n tokens |
|
A pattern that is complete when there is exactly one matching token |
|
A pattern where tokens can be in any order Notes: Experimental - only works for straight-forward, unambiguous cases. Terms from InSeries and AtLeastN patterns match sequential tokens, even when wrapped within InParallel It may be possible to handle AtLeastN terms as non-sequential, but a look-ahead match algorithm is needed? |
|
A pattern where tokens must be in sequential order |
|
A pattern that is complete when there are one or more matching tokens |
|
A pattern that matches zero or one optional token |
API#
- class signoffs.core.signing_order.signoff_pattern.AnyOneOf(*pattern, **kwargs)[source]#
Bases:
signoffs.core.signing_order.signoff_pattern.PatternSetA pattern that matches any one of a set of alternate patterns
Initialization
Wrap any “naked” tokens in an ExactlyOne
- regex_pattern_constructor#
None
- class signoffs.core.signing_order.signoff_pattern.AtLeastN(*pattern, n=1, **kwargs)[source]#
Bases:
signoffs.core.signing_order.signoff_pattern.NTokenPatternA pattern that is complete when pattern has at least some min. number of tokens. Note: match algorithm consumes all consecutive matching tokens (greedy)
Initialization
Initialize with sequence of SigningOrderPattern objects (or any of its subclasses)
- regex_pattern_constructor#
None
- class signoffs.core.signing_order.signoff_pattern.ExactlyN(*pattern, n=1, **kwargs)[source]#
Bases:
signoffs.core.signing_order.signoff_pattern.NTokenPatternA pattern that is complete with exactly n tokens
Initialization
Initialize with sequence of SigningOrderPattern objects (or any of its subclasses)
- regex_pattern_constructor#
None
- class signoffs.core.signing_order.signoff_pattern.ExactlyOne(*pattern, token_repr=signoff_repr, **kwargs)[source]#
Bases:
signoffs.core.signing_order.signoff_pattern.TokenPatternA pattern that is complete when there is exactly one matching token
Initialization
Initialize with sequence of SigningOrderPattern objects (or any of its subclasses)
- regex_pattern_constructor#
None
- class signoffs.core.signing_order.signoff_pattern.InParallel(*pattern, **kwargs)[source]#
Bases:
signoffs.core.signing_order.signoff_pattern.PatternSetA pattern where tokens can be in any order Notes: Experimental - only works for straight-forward, unambiguous cases. Terms from InSeries and AtLeastN patterns match sequential tokens, even when wrapped within InParallel It may be possible to handle AtLeastN terms as non-sequential, but a look-ahead match algorithm is needed?
Initialization
Wrap any “naked” tokens in an ExactlyOne
- regex_pattern_constructor#
None
- class signoffs.core.signing_order.signoff_pattern.InSeries(*pattern, **kwargs)[source]#
Bases:
signoffs.core.signing_order.signoff_pattern.PatternSetA pattern where tokens must be in sequential order
Initialization
Wrap any “naked” tokens in an ExactlyOne
- regex_pattern_constructor#
None
- class signoffs.core.signing_order.signoff_pattern.OneOrMore(*pattern, token_repr=signoff_repr, **kwargs)[source]#
Bases:
signoffs.core.signing_order.signoff_pattern.TokenPatternA pattern that is complete when there are one or more matching tokens
Initialization
Initialize with sequence of SigningOrderPattern objects (or any of its subclasses)
- regex_pattern_constructor#
None
- class signoffs.core.signing_order.signoff_pattern.Optional(*pattern, token_repr=signoff_repr, **kwargs)[source]#
Bases:
signoffs.core.signing_order.signoff_pattern.TokenPatternA pattern that matches zero or one optional token
Initialization
Initialize with sequence of SigningOrderPattern objects (or any of its subclasses)
- regex_pattern_constructor#
None