Skip to content
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

Formatting of dictated numbers #386

Open
drmfinlay opened this issue Feb 17, 2024 · 3 comments
Open

Formatting of dictated numbers #386

drmfinlay opened this issue Feb 17, 2024 · 3 comments
Labels
Enhancement Enhancement existing feature

Comments

@drmfinlay
Copy link
Member

Dragonfly's dictation word formatting does not include the transformation of number words into numerals. For example, if, as part of a command using a Dictation element, I say "forty two", the matching rule will receive the words "forty two", instead of the numeral form 42.

Dragon itself has extensive support and configuration for this which would not be feasible to implement in Dragonfly. I think, however, some basic transformations could be done. These would be optional and would use the active dragonfly.language implementation (based on the SR engine language).

@drmfinlay drmfinlay added the Enhancement Enhancement existing feature label Feb 17, 2024
@drmfinlay
Copy link
Member Author

Maybe this formatting could be applied with a separate NumeralWordFormatter class with the following function:

def format_words(input, min, max, language=None):
    ...
    ...
    ...

That way it could be used with any engine and could be subclassed to add in contextual spacing for things like phone numbers, if desired.

@LexiconCode
Copy link
Member

Maybe this formatting could be applied with a separate NumeralWordFormatter class with the following function:

def format_words(input, min, max, language=None):
    ...
    ...
    ...

That way it could be used with any engine and could be subclassed to add in contextual spacing for things like phone numbers, if desired.

I do like that approach with any engine.

@drmfinlay
Copy link
Member Author

It would be nice if this feature also handled words like 'double', 'triple', 'dot' and 'point'. Of course, things common in one language are often not common in another. Apparently this is the case for double X and triple X. English has this, but the German language, for instance, does not.

So things like this should be done in language-specific functions under dragonfly.language.

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

No branches or pull requests

2 participants