wake_phrases
wake_phrases
¶
Wake-word phrase matching (Diapason-style text gate for « Diapason »).
Functions:¶
build_wake_pattern
¶
build_wake_pattern(
variants: Sequence[str] | None = None,
prefixes: Sequence[str] | None = None,
) -> Pattern[str]
Match wake phrase at the start of an utterance.
Source code in src/diapason/speech/wake_phrases.py
has_wake_word
¶
True if text opens with an address to Diapason.
Source code in src/diapason/speech/wake_phrases.py
strip_wake_word
¶
Remove leading wake address. « Diapason, ouvre YouTube » → « ouvre YouTube ».