Tips for Investigation 5
by Christine Alvarado, March 2010
- Work through or at least look at the first several tutorials at http://www.vxml.org/.
You should keep this reference page handy as you are developing.
Note that the second tutorial has a bug: you must enclose the
line "
Please say your favorite South Park character's name." in a <prompt> tag.
- There are some very nice
built-in grammars listed that you can find under the "GSL Grammar's" link in the left hand navigation bar at http://www.vxml.org/. My sample application uses one of those. Always use the GSL grammar type.
- To achieve more freedom in design than the form structure
allows, consider using universal grammars along with event handlers.
There is an example of this in my example application (the link tags at
the top that allow the user to say "main" and "done"). Note that
if you're just doing this, you'll need to have a single form
that can't accept input so that the call won't just be dropped
immediately. In my application this is the "Again" form.
- All of your inline scripts and grammars should use the
<![CDATA[ ... ]]> notation. It will save you from wasting time
debugging strange errors (unless they are VERY simple).
- The W3CSchools website has good Javascript tutorials, and they
provide webpages where you can mess around with Javascript and execute
small pieces of it (http://www.w3schools.com/jsref/default.asp is the reference, http://www.w3schools.com/JS/tryit.asp?filename=tryjs_formattext
is one of the live Javscript pages.). This is a good way to test bits
of Javascript and debug them without going through the whole
upload-call-view log cycle.
- When programming in Javascript, you can get detailed error
information via your browser's error console. Also note that at Voxeo,
all of your variables must be declared using the "var" keyword,
or via xml tags.
- To run your applications you can either use their file
hosting service or you can use your HMC public_html web space. I
STRONGLY recommend the latter (using your HMC web space), as their file
system seems to have a long lag time before it updates changes.
- The debugging cycle at Voxeo is generally:
- Update your file, save it, and upload it.
- Call the application number (use speeddial, or at least write
it on a piece of paper). Interact
appropriately with your application, until bad behavior or an error
occurs.
- You can use the Application Debugger or the Files, Logs, Reports tool to help you with your debugging.
- Make only SMALL changes between each test. Test often.
- One note on grammars: the power of the speech recognition is
largely dependent on constraints introduced by the grammar. This means
that the more ambiguous your grammar, the more likely it is to make
mistakes. As an example, when testing the given datetime grammar, I
tried the phrase "rutabega". Instead of failing, the grammar produced
"May 3". With the full date.grammar, you'll find it almost always
interprets whatever you say as something. This might not be a bad thing, but if you want to be sure you're not making mistakes, try to limit how much of
your grammar is active at any particular moment, when you can.
Good luck with this assignment, and if you're having trouble with something, email cs124help@cs.hmc.edu.
Also, don't worry too much about building elegant grammars. Feel free
to brute-force your grammars to get them to work, and if you find
something that would be incredibly painful to implement in a grammar,
it's fine to note that you couldn't reasonably accomplish that part of
your design and use a simpler placeholder. The assignment says to note
things that are impossible, but when it comes to grammars, if you're
spending hours trying to get something seemingly simple to work, it
falls under the category of "not reasonably possible".