JSGF grammar is defined for speakable units of language such as
words that do not require the need for dummy terminal symbols
like START and END. However, we have extended the JSGF usage to
specify non-speakable units such as model-topology that require
the usage of these terminal symbols. ISIP DiGraph defines two
default vertices to start and end graph. Similarly, for JSGF
format, we have reserved two symbols to represent the start and
end graph vertices as shown in the example below.
#JSGF V1.0;
// Define the grammar name
grammar network.grammar.ISIP_JSGF_START;
// Define the ISIP graph start symbol
public <ISIP_JSGF_1_0_START> = S;
#JSGF V1.0;
// Define the grammar name
grammar network.grammar.ISIP_JSGF_TERM;
// Define the ISIP graph terminal symbol
public <ISIP_JSGF_1_0_TERM> = T;
Users have the option to choose the symbols to be reserved. In
the above example, we chose "S" and "T" as the start and end
symbols. Now, these two reserved symbols can be used without
the need of explicitly defining the start and the end symbol
again. For example, the SILENCE model definition uses reserved
symbols "S" and "T" for the start and end symbols.
@ JSGF 1 @
algorithm = "JSGF";
grammar = {
#JSGF V1.0
// Define the grammar name
grammar network.grammar.SILENCE;
// Define the rules
public <SILENCE> = <ISIP_JSGF_1_0_START> /0/ sil /0/ <ISIP _JSGF_1_0_TERM>;
};
These special symbols are reflected in the output Sof language
model file under the tag @ JSGF 100 @, which is also a special
reserved Sof object tag as shown:
@ JSGF 100 @
algorithm = "JSGF";
grammar = {
#JSGF V1.0
// Define the ISIP DiGraph default starting vertex
grammar network.grammar.ISIP_JSGF_START;
public <ISIP_JSGF_1_0_START> = S;
};
grammar = {
#JSGF V1.0
// Define the ISIP DiGraph default ending vertex
grammar network.grammar.ISIP_JSGF_TERM;
public <ISIP_JSGF_1_0_TERM> = T;
};