talonvoice / talon

Issue Tracker for the main Talon app
85 stars 0 forks source link

quadratic? parsing time for format_text-like capture #290

Open rntz opened 3 years ago

rntz commented 3 years ago

Was told to file this, https://gist.github.com/rntz/bfbca3367f6cb879605c6e146bc6455a

Copying files from gist:

quadratic.py

from talon import Module
mod = Module()
@mod.capture(rule="<user.text> (<user.text> | <user.letter>)*")
def quadratic_format_text(m) -> str:
    """"""
    return str(m)

# # Doesn't depend upon knausj, but requires a few more iterations to watchdog.
# # eg. 'fast quadratic hello air air air air air air air air air air air air air'
# @mod.capture(rule="<phrase> (<phrase> | air)*")
# def quadratic_format_text(m) -> str:
#     """"""
#     return str(m)

quadratic.talon

# watchdogs on 'fast quadratic hello air bat cap drum each fine gust harp sit jury crunch'
fast quadratic <user.quadratic_format_text>: "{quadratic_format_text}"

# watchdogs on 'slow quadratic hello air bat cap drum each fine gust harp sit jury crunch look made near'
slow quadratic <user.quadratic_format_text>$: "{quadratic_format_text}"
lunixbochs commented 3 years ago

I bet this is related, another user hit a quadratic parse with just <phrase>: skip() and a long command