RangerMauve / mauve-dictation

Custom scripts for nerd-dictation that i use for programming
4 stars 1 forks source link

Switch between the modes? #1

Open zenny opened 3 months ago

zenny commented 3 months ago

@RangerMauve Thanks for sharing your configuration of nerd-dictation.

Nevertheless I am just wondering how to switch between different speaking modes while dictating? Though the default seems to be 'speak' mode, but your configs without any changes defaults to 'dictate' mode. I am using:

$ ./nerd-dictation begin --continuous --numbers-as-digits --timeout 10 --idle-time 0.5 --vosk-model-dir=./model --config=./mauve-dictation/nerd-dictation.py&

Would you mind explaining how to change the modes of dictation and launch the default mode?

Cheers, /z

RangerMauve commented 3 months ago

Yeah, ty for asking. The default mode is there for doing quick notes and speech while I'm talking to folks.

I usually use the other modes for coding since I don't need spaces and there's no easy way to switch from lower and upper case.

To enable them I say mode and the mode I wish to enable, e.g. `"mode camel" to enable camelCase.

Here's what the modes do:

I've been thinking of adding more modes for stuff like Zalgo text or other jokey things but it hasn't been as important.

Also been wanting to persist the last used mode to the filesystem, but again haven't had enough urgency for it. PRs are welcome tho.

You can add new modes by adding functions to this map: https://github.com/RangerMauve/mauve-dictation/blob/default/nerd-dictation.py#L263

The function should take a string and return a string.

RangerMauve commented 3 months ago

Ah to be clear the "modes" in my script are different from modes in nerd-dictation.

zenny commented 3 months ago

Yeah, ty for asking. The default mode is there for doing quick notes and speech while I'm talking to folks.

I usually use the other modes for coding since I don't need spaces and there's no easy way to switch from lower and upper case.

To enable them I say mode and the mode I wish to enable, e.g. `"mode camel" to enable camelCase.

Unfortunately the mode switch is not happening after saying "mode speak" in my case. Is there any other configuration tweaks one ought to do?

Here's what the modes do:

* speak: separate words with spaces and use lowercase

* cap: like speak but hitting capslock to make everything capitalized

* snake: Instead of spaces use underscores kind_of_like_this. Useful for python variable names

* screaming snake: a combo of cap and snake. Useful for variable names LIKE_THIS

* camel: enables "camel case" where instead of spaces words are joined together with the first letter of each word being capitalized `likeThis`. Useful for variable names in c/javascript

* proper camel: Like camel but the first word is also capitalized. `LikeThis`. Useful for class names in Java

* dictate: I think I had this before I fixed the NATO phonetic alphabet adding uncesessary spaces. It just removes spaces

Thanks for comprehensive explanation of modes.

I've been thinking of adding more modes for stuff like Zalgo text or other jokey things but it hasn't been as important.

Also been wanting to persist the last used mode to the filesystem, but again haven't had enough urgency for it. PRs are welcome tho.

You can add new modes by adding functions to this map: https://github.com/RangerMauve/mauve-dictation/blob/default/nerd-dictation.py#L263

The function should take a string and return a string.

RangerMauve commented 1 month ago

Try adding some print statements n the script to see if the correct inputs are being passed to it. :thinking: Are you sure the custom scripts are being invoked in the first place?