Using regular expressions in JSGF file
I am trying to make a speech UI using cloud garden' implementation of JSAPI. When the user says "Create a frame with name <name>' my speech recognition software should recognize that the user wants to create a frame and it should take the name of the frame. So, I make a .jsgf file which has my grammar like this:
public <componentGrammar> = <command> <article> <component> <connector> <rule>;
<command> = create | make | remove ;
<article> = a | an | the | one ;
<component> = frame | panel | tabbedpane|splitpane|scrollpane|toolbar|internalfr ame|layeredpane|label|button|togglebutton|checkbox |radiobutton|buttongroup|combobox|list|textfield|t extarea|scrollbar|slider|progressbar|formattedfiel d|passwordfield|spinner;
<connector> = [with] name [equal to] ;
<rule> = ?
The problem with this is that this grammar should be able to detect the frame name which can be anything like this /a-zA-Z0-9/*. This is what should go into my <rule>. But putting
<rule> = /a-zA-Z0-9/*
is not taking it correctly. It is not recognizing this as a regular expression. I have also tried
<rule> = (/a-zA-Z0-9/)
but nothing is working. Please let me know how to do this. Without this, my whole project is limited.