user.core.text.text_and_dictation.py
Modules
Actions
- user.dictation_format_cap()
Sets the dictation formatter to capitalize
- user.dictation_format_no_cap()
Sets the dictation formatter to not capitalize
- user.dictation_format_no_space()
Sets the dictation formatter to not prepend a space
- user.dictation_format_reset()
Resets the dictation formatter
- user.dictation_insert(text: str, auto_cap: bool = <class 'bool'>) str
Inserts dictated text, formatted appropriately.
- user.dictation_insert_raw(text: str)
Inserts text as-is, without invoking the dictation formatter.
- user.dictation_peek(left: bool, right: bool) tuple[typing.Optional[str], typing.Optional[str]]
Gets text around the cursor to inform auto-spacing and -capitalization. Returns (before, after), where `before` is some text before the cursor, and `after` some text after it. Results are not guaranteed; `before` and/or `after` may be None, indicating no information. If `before` is the empty string, this means there is nothing before the cursor (we are at the beginning of the document); likewise for `after`. To optimize performance, pass `left = False` if you won't need `before`, and `right = False` if you won't need `after`. dictation_peek() is intended for use before inserting text, so it may delete any currently selected text.
- user.dictation_reformat_cap()
Capitalizes the last utterance
- user.dictation_reformat_no_cap()
Lowercases the last utterance
- user.dictation_reformat_no_space()
Removes space before the last utterance
Captures
- user.prose_modifier: typing.Callable
- {user.prose_modifiers}
- user.prose_simple_number: str
- (numb | numeral) <user.number_string>
- user.prose_number_with_dot: str
- (numb | numeral) <user.number_string> (dot | point) <digit_string>
- user.prose_number_with_colon: str
- (numb | numeral) <user.number_string> colon <user.number_string>
- user.prose_number: str
- <user.prose_simple_number> | <user.prose_number_with_dot> | <user.prose_number_with_colon>
- user.word: str
- ({user.vocabulary} | <word>)
A single word, including user-defined vocabulary.
- user.text: str
- ({user.vocabulary} | <phrase>)+
A sequence of words, including user-defined vocabulary.
- user.prose: str
- ({user.vocabulary} | {user.punctuation} | {user.prose_snippets} | <phrase> | <user.prose_number> | <user.prose_modifier>)+
Mixed words and punctuation, auto-spaced & capitalized.
- user.raw_prose: str
- ({user.vocabulary} | {user.punctuation} | {user.prose_snippets} | <phrase> | <user.prose_number>)+
Mixed words and punctuation, auto-spaced & capitalized, without quote straightening and commands (for use in dictation mode).
Lists
- user.prose_modifiers
Modifiers that can be used within prose
'cap' 'cap' 'no cap' 'no_cap' 'no caps' 'no_cap' 'no space' 'no_space'
- user.prose_snippets
Snippets that can be used within prose
'spacebar' ' ' 'new line' '\n' 'new paragraph' '\n\n' 'open quote' '“' 'close quote' '”' 'smiley' ':-)' 'winky' ';-)' 'frowny' ':-('
Settings
- user.context_sensitive_dictation: bool
Look at surrounding text to improve auto-capitalization/spacing in dictation mode. By default, this works by selecting that text & copying it to the clipboard, so it may be slow or fail in some applications.