Skip to content

Consider stripping dragon junk before parsing commands #165

@knausj85

Description

@knausj85

Dragon provides inconsistent results with a capture like the below, designed to allow punctuation via the 'say' command

@mod.capture(rule="({user.vocabulary} | {user.punctuation} | <phrase>)+")
def prose(m) -> str: return format_phrase(m)

This occurs whether or not e.g. "," and "." are in the user.punctuation list.

(from https://github.com/rntz/knausj_talon/blob/d746b7b2a7b2a88025a710113c1b789a16f00a11/code/vocabulary.py#L20

e.g., the below works as expected
say this is a test comma so far it is working period -> this is a test, so far it is working. where the punctuation is correctly captured.

on the other hand, the below is caught as a single <phrase> with the requisite dragon junk parsed by actions.dictate.parse_words()
say so far comma it is working well period -> so far comma it is working well period

It seems we have two potential options:
(1) a variant of actions.dictate.parse_words with the old behavior (returning the symbol) that we can use as required; or
(2) Talon could potentially strip dragon junk before parsing commands

Option 2 seems like a potentially better solution.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions