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#

AnyOneOf

A pattern that matches any one of a set of alternate patterns

AtLeastN

A pattern that is complete when pattern has at least some min. number of tokens. Note: match algorithm consumes all consecutive matching tokens (greedy)

ExactlyN

A pattern that is complete with exactly n tokens

ExactlyOne

A pattern that is complete when there is exactly one matching token

InParallel

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?

InSeries

A pattern where tokens must be in sequential order

OneOrMore

A pattern that is complete when there are one or more matching tokens

Optional

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.PatternSet

A 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.NTokenPattern

A 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.NTokenPattern

A 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.TokenPattern

A 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.PatternSet

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?

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.PatternSet

A 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.TokenPattern

A 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.TokenPattern

A pattern that matches zero or one optional token

Initialization

Initialize with sequence of SigningOrderPattern objects (or any of its subclasses)

regex_pattern_constructor#

None