Results 1 to 3 of 3
- 11-28-2010, 04:02 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
Using regular expressions in JSGF file
Hi
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.
- 11-28-2010, 04:30 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
According to the grammar definition there's no way to specify a regular expression in a rule expansion.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-28-2010, 04:32 PM #3
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Using regular expressions for search
By carderne in forum New To JavaReplies: 9Last Post: 05-24-2009, 04:58 AM -
Regular Expressions in java
By blue404 in forum Advanced JavaReplies: 2Last Post: 09-26-2008, 03:43 AM -
Using Quantifiers in regular expressions
By Java Tip in forum Java TipReplies: 0Last Post: 01-10-2008, 10:43 AM -
Capturing Groups using regular expressions
By Java Tip in forum Java TipReplies: 0Last Post: 12-25-2007, 11:19 AM -
Regular expressions quantifiers
By Java Tip in forum Java TipReplies: 0Last Post: 12-25-2007, 11:18 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks