[Space]

The [space] section defines spacing rules for the topic, determining how many spaces are inserted between words. The space section contains a series of lines (separated by "\n" or "\n\r"). Each line represents a "rule" that determines if a space is used between two words (or symbols.) The parser analyzes each rule in priority from first to last.

Each line contains three "strings", optionally followed by some commands in curly braces. The first string indicates what text occurs to the left of the possible space, the second string indicates what characters are to the right, and the last string contains the number of spaces to insert. Note that the left string is in reverse order.

Each "string" is a quote, followed by a series of characters, ended by a quote, just like a C/C++ string. A backslash followed by another backslash is interpreted as just a backslash, while a backslash followed by another character is interpreted as a control sequence. A capital "A" represents any non-space character.

The commands on the lines can be:

{<number>} and {!<number>} - Indicate that the rule is to be used based upon the state of an options switch. For example, "{5}" indicates that the rule is used if switch 5 is on, while {!5} indicates the rule is only used if switch 5 is turned off.

{E<one character in quotes} and {O<one character in quotes>} - Indicates that the rules is turned on if there are an even (or odd) number of the specified character in the current line. A line is denoted by a carriage-return or line-feed character. Example: {E"\""} looks for an even number of quotes in the current line.

Here are subset of the spacing rules used for Voice Dictation English:

[Space]

"" "." ""

"" "," ""

"" "\\" ""

"" ":" ""

"" ";" ""

"" "%" ""

"" "?" ""

"" "!" ""

"\" " "" ""

"" "\"" " " {E"\""}

"" "\"" "" {O"\""}

"* " "" ""

"" "*" " " {E"*"}

"" "*" "" {O"*"}

.\period "" " " {1}

.\period "" " " {!1}

"?" "" " " {1}

"?" "" " " {!1}

"!" "" " " {1}

"!" "" " " {!1}

"" "/" ""

"/A" "" ""

"-" "-" ""

"--" "" " "

"" "--" " "

"-A" "" ""

"" "-" ""

"(" "" ""

"A" ")" ""

"[" "" ""

"A" "]" ""

"{" "" ""

"A" "}" ""

"<" "" ""

"A" ">" ""

"\n" "" ""

"\r" "" ""

"\t" "" ""

"" "\n" ""

"" "\r" ""

"" "\t" ""

Since the rules are evaluated from first to last, the first rule evaluated is:

"" "." ""

The first string, containing empty quotes, means that it doesn't matter what text is to the left. The next string with just a period indicates that the rule is used if a period is to the right of the possible space insertion. The third string, empty quotes, means that no text is inserted. Hence, the first rule says, don't insert spaces if there's a period to the right of it. This causes periods to "snuggle" up to text to the left.

Further on down the list you see:

.\period "" " " {1}

.\period "" " " {!1}

"?" "" " " {1}

"?" "" " " {!1}

"!" "" " " {1}

"!" "" " " {!1}

This set of rules either places one or two spaces after sentences. If option switch 1 is TRUE then two spaces are inserted between sentences. If it's FALSE then only one space appears between sentences. The first string indicates that a sentence ends with a period, question mark, or exclamation point. The second string indicates that it doesn't matter what's to the right. The third string has one or twos space in it.

Another interesting set of rules is:

"\" " "" ""

"" "\"" " " {E"\""}

"" "\"" "" {O"\""}

This pair of rules causes quotes to work. The first string indicates that a word after a quote snuggles up to the quote. The next two lines cause quotes to alternate between a word before the quote snuggling or not. Without this rule, the phrase, "he said quote hello quote" becomes "He said " hello"". With it, "He said "hello"".