text_lint.operations.lookups.capture.CaptureLookup

class text_lint.operations.lookups.capture.CaptureLookup(lookup_name: str, lookup_expression: LookupExpression, lookup_params: AliasLookupParams, requesting_operation_name: str)[source]

Bases: LookupBase

CaptureLookup operation for ResultForest instances.

class Parameters[source]

Bases: Parameters

Parameter validation for this operation.

__init__(lookup_name: str, lookup_expression: LookupExpression, lookup_params: AliasLookupParams, requesting_operation_name: str) None[source]

Initialize CaptureLookup instances.

Parameters:
  • lookup_name (str) – The name of this lookup operation.

  • lookup_expression (LookupExpression) – The lookup expression this lookup is a part of.

  • lookup_params (AliasLookupParams) – The parameters being used with this lookup operation.

  • requesting_operation_name (str) – The name of the validation operation.

Raises:

LookupFailure

apply(state: LookupState) None[source]

Select a capture group from the current ResultForest location.