talonhub / community

Voice command set for Talon, community-supported.
MIT License
625 stars 780 forks source link

Consistent customisable way to use decimals #1245

Open auscompgeek opened 1 year ago

auscompgeek commented 1 year ago

In the CSS support there's a couple of commands that recognise decimals:

https://github.com/talonhub/community/blob/d9c6373661eb937fc6fc1a29df4bfdce54b6914a/lang/css/css.talon#L27-L29

This only recognises how decimals are typically taught to be read in English-speaking classrooms (e.g. three point one four for 3.14). Some people might like to be able to dictate the fractional part of decimals like whole numbers though, e.g. twelve point thirty four for 12.34. Others might prefer to say dot instead of point.

We should add a decimal_string capture to allow this to be reused in other commands and customised globally.

auscompgeek commented 1 year ago

Something else just came to mind: not all locales use . for decimals, instead using ,. For programming though we'll still want a way to dictate decimals using . – not sure what the best way to do this is.

auscompgeek commented 1 year ago

Oh, interesting, just took a look at how we do it in dictation mode and we have a similar construction to what we have in CSS:

https://github.com/talonhub/community/blob/d9c6373661eb937fc6fc1a29df4bfdce54b6914a/core/text/text_and_dictation.py#L49-L51

AndreasArvidsson commented 2 months ago

I would just extend the normal number command with this ability. We can either do two separate commands in the Talon file or make a capture that enables both? eg https://github.com/AndreasArvidsson/andreas-talon/blob/bd3e75779295d9f139d8bc614ecb54e50899d704/core/numbers/numbers.py#L207-L213