tts_fresh.utils

Submodules

tts_fresh.utils.modal_bool

class tts_fresh.utils.modal_bool.ModalBool(*values)

Bases: Enum

Implements a three-valued logic system consisting of YES, NO, and MAYBE states. This enum provides standard boolean-like operations such as AND, OR, and NOT, allowing for more nuanced conditional logic where certainty is not always guaranteed. It is particularly useful for validation rules that may have indeterminate results based on the provided sequence data.

MAYBE = 1
NO = 0
YES = 2
static of(b) ModalBool

Converts a standard boolean value or an existing ModalBool instance into a ModalBool type. This utility ensures type consistency by mapping True/False values to YES/NO while passing existing ModalBool states through unchanged. It serves as a constructor-like helper for normalizing inputs before performing logical operations.

Parameters:

b (bool or ModalBool) – The value to be converted, which can be a boolean or a ModalBool instance.

Returns:

The corresponding ModalBool representation of the input.

Return type:

ModalBool

tts_fresh.utils.step_utils