rhasspy / wyoming-vosk

Wyoming protocol server for the vosk speech to text system
MIT License
10 stars 5 forks source link

Feature request: In/out replacement backreference #4

Open h3ndrik opened 9 months ago

h3ndrik commented 9 months ago

I'd like to do the following:

sentences:
  - in: "dim <light>"
    out: "set <light> brightness to 25"
expansion_rules:
  light: "(livingroom light|kitchen light)"

As of now it literally writes set <light> brightness to 25 to the corrected transcript. I'd like this to work like named backreferences in a regex and replace the placeholder in the out part with whatever it captured earlier. (set kitchen light brightness to 25)

This should obviously work both for lists and expansion_rules. And maybe a short example could be added to the README.md

dekiesel commented 3 days ago

This feature would really cut down on complexity/nr of rules. At the moment you basically have to create an extra sentence for every domain/setting.