[Rules]

The [rules] section contains rules for the context free grammar. Each line can be one of the following:

A comment, starting with two slashes, "//".

The definition of a rule.

A rule definition is:

<rule name> = {series of symbols}

The rule name can not have a space in it. It is cases insensitive. If the name is new then a new rule is created. If the name is a duplicate of another rule, then it as added as an alternative to the other rule. The main rule is <Start>, so every rule must be referenced directly or indirectly by <Start> for it to be used.

The symbols can be selected from the following:

<rule name> - Another rule.

"string" - A string that is entered into the text if the rule proves valid.

word - Word that must be spoken for the rule to be valid.

[opt] - Indicates that the next symbol is optional.

[1+] - Indicates that the next symbol must be repeated one or more times.

{<number>} - Requires an option switch to be TRUE in order for the rule to be valid.

{!<number>} - Requires an option switch to be FALSE in order for the rule to be valid.

Here some example rules:

<Start> = {2} <Acronym>

<Start> = {3} <Digits>

<Acronym> = <Letter> [1+] <Letter>

<Letter> = A. "A" <PeriodAfter>

<Letter> = B. "B" <PeriodAfter>

<Letter> = C. "C" <PeriodAfter>

<Letter> = D. "D" <PeriodAfter>

// etc.

<PeriodAfter> = {4} "."

<PeriodAfter> = {!4} ""

<Digits> = <Digit> [1+] <Digit>

<Digit> = zero "0"

<Digit> = oh "0"

<Digit> = one "1"

<Digit> = two "2"

// etc.

The <Start> rule links all of the other rules. It allows a user to speak acronyms or digits. The {2} and {3} are option switches that allow the user to turn on/off the acronym and digit inverse text normalization.

The acronym rule requires that the user speaks at least two letters in a row before it turns on so that if the user dictates "fred z smith" it becomes "Fred Z. Smith" and not "Fred Z Smith". The <Acronym> rule references the <Letter> rule, which contains one entry per letter.

<Letter> = B. "B" <PeriodAfter>

The "B." indicates that the user speaks that letter. The ""B"" is the text typed in. The <PeriodAfter> rule might insert a period if rule 4 is turned on, or nothing if it is off. If rule 4 is on, the dictated text, "F. E. I. F." becomes "F.E.I.F.", but if it's off, the dictated text becomes "FEIF".

Digits work in a similar manner.