Skip to content

Alternative repetition behavior, "repeat this utterance so far" #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jgarvin opened this issue Oct 24, 2020 · 2 comments
Closed

Alternative repetition behavior, "repeat this utterance so far" #119

jgarvin opened this issue Oct 24, 2020 · 2 comments

Comments

@jgarvin
Copy link

jgarvin commented Oct 24, 2020

I think repeat_phrase would be more useful/intuitive if when it appeared in with other things in an utterance it meant "repeat again all of the current utterance so far" rather than "repeat the previous utterance." Like if I say "all hail caesar" then pause, then say "foo bar buzz rep" I expect it to do "foo bar buzz" again, not "all hail caesar".

In mandimus I had some code to treat the repetition command specially, so the utterance history would automatically be broken whenever a repetition came in, to get this effect. This way if I said "rep" as an utterance it really did repeat the previous utterance, but if I said it as part of a larger utterance it would repeat what I had just said.

Note that just adding a separate "repeat this utterance so far" action would not quite give the desired effect, since then "rep" by itself or at the start of a new utterance would do nothing. You could maybe make it work by combining 2 rules:

rep : actions.repeat_so_far(number-1)
$rep : actions.repeat_phrase(number-1)

I dunno if talon prioritizes $ rules though.

@lunixbochs
Copy link

In next beta:

core.repeat_partial_phrase()
core.repeat_partial_phrase(2)

This will repeat the current phrase, but if the current phrase is empty, it will repeat the entire previous phrase.

I may change the behavior down the line based on feedback, for example right now:

air bat repeat(2) -> ababab
repeat(2) -> abab

air bat -> ab
repeat(2) -> abab

air bat repeat(2) comma cap drum repeat(2) -> ababab,cdab,cdab,cd

but I may want something that behaves like this and thus later change core.repeat_partial_phrase() to satisfy this:

# subtract 1 for partial phrase repeat
air bat repeat(2) -> abab
repeat(2) -> abab

# "reset" the partial phrase if you have multiple repeat points without a pause
air bat repeat(2) cap drum repeat(2) -> ababcdcd

@jgarvin
Copy link
Author

jgarvin commented Oct 30, 2020

Awesome, will try this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants