Brackets (put around text)
Note: this grammar is initially in the DisabledGrammars subdirectory of Unimacro. Copy the python file (_brackets.py) to the Unimacro directory, and switch the grammar on with the next command:
command | comment |
switch (on|off) brackets | control the on/off state of this grammar. |
The grammar:
command | comment |
between {brackets} | insert brackets around the selected text, or simply put the brackets, with the cursor inside. |
between {brackets} <dgndictation> | print your dictated text inside the brackets |
Examples:
command | result ( | shows the cursor position after the command) |
between brackets hello world | (hello world)| |
between quotes Cap my favorite test period just kidding period | "My favorite test. Just kidding."| |
between braces space-bar another thing space-bar | {another thing} | (put a space before and after the braces) |
between angle brackets space-bar | <|> (a special case, and insert a space before the <. Position the cursor between the angle brackets.) |
between quotes brackets | "(|)" (more brackets together, and puts the cursor in the middle) |
between HTML angle brackets | <|> (special case, if a | in a brackets definition, the cursor is put in the place of this vertical bar) |
- If you put brackets around selected text, whitespace before or after the selection is maintained and put outside the brackets.
- If you dictate space-bar at the start or the end of the dictated text, a space will be inserted before or after, but outside the brackets.
- But note: first give the command words like between brackets or between single quotes etc.
- Control your own set of brackets by calling edit brackets and editing the _brackets.ini configuration file (and see sample below).
Warning
You cannot correct dictation errors when you use the <dgndictation> imported rule. Select text that went wrong, and redictate. If then an error occurs, you can correct your dictate.
Sample configuration file
[brackets] angle brackets = <> asteriscs = ** braces = {} brackets = () colons = :: double angle brackets = <<>> double quotes = '""' double underscores = ____ parens = () parenthesis = () quotes = '""' single quotes = "''" square brackets = [] triple quotes = '""""""' underscores = __ vertical bars = || HTML square brackets = [|] HTML angle brackets = <|> [general] initial on = 0 [grammar name] name = brackets [grammar words] between = between
- Note the vertical bar to give the cursor position in case of asymmetric brackets.
- The grammar word between can have synonyms, for example between = between | inside
- When the grammar is switched on, you will see initial on = 1.
- For single and double quotes the definition must be double or single quoted, a peculiarity of the ini file mechanism.
|