dictation-toolbox / dragonfly

Speech recognition framework allowing powerful Python-based scripting and extension of Dragon NaturallySpeaking (DNS), Windows Speech Recognition (WSR), Kaldi and CMU Pocket Sphinx
GNU Lesser General Public License v3.0
375 stars 73 forks source link

Add a way to format Dragon's dictation words using the spoken form #387

Open drmfinlay opened 3 months ago

drmfinlay commented 3 months ago

Dragon provides us with written and spoken forms for words. It would be nice if the spoken form of dictated words could be used sometimes. A good use case is where one wishes to type words like "period", which Dragon and Dragonfly both normally output as a dot (".").

An optional in_spoken_form parameter could be added to the appropriate formatting methods and documented.

There is actually a Dragon built-in rule for this — the dgnwords rule. Unfortunately, this rule stopped working properly some while ago, as did the dgnletters rule.

drmfinlay commented 2 months ago

Actually, the special built-in rules I mentioned above do mostly work. They just need a bit of patching. I'll add special element classes under dragonfly.engines.backend_natlink for using them. These already exist in the examples folder, but are not importable.

I'll add a special element class for dgndictation, too, for completeness' sake.

drmfinlay commented 2 months ago

I think the new spoken_form parameter is good enough. I won't add the new element classes.