Old post but same challenge...
I need to accept Date of Birth with ASR. I will have a Nuance server at some point but not provisioned yet.
I am writing script and trying to accept a DoB entry. I have tried the built-in date grammar but it never gets it right in the simulator. Is this a simulator issue?
I saw attachment so downloaded.
I tried to copy/paste logic into static type, I also tried editing the java for built-in derived file, neither compile and I get warnings.
I was able to add as external grammar by dropping the date.xml into root of my test box website, the "Test" button in the external editor shows the content. However, when I try to say a date I get no response, as though it has no ASR grammar for the input.
Can I ask how this is supposed to be used?
as a note, I am using en-gb for script
/edit: I do get a response now with simulator (forgot to change language from en-us to en-gb in date.xml)
However, the value is not formatted as would expect if using built-in date (yyyymmdd)
What I get in log is, last 3 lines are trace output for the var;
Storing :DOBCapture___utterance to complex: DOBCapture:utterance as [sixteen September nineteen ninety six]
Storing :DOBCapture___value to complex: DOBCapture:value as [16]
Date Value | DOBCapture:value : 16
Date Utterance | DOBCapture:utterance : sixteen September nineteen ninety six
Date interpretation | DOBCapture:interpretation : 16
Looking at OD help (dark art....) it mentions a cxtag but not worked out how to incorporate that into the date.xml (if that is required)
/edit2:
Found and realised the date.xml you linked is same as the one found in OD plugins and it does not appear to handle naturally spoken (at least in English) day i.e. "First", "eighth", "fourteenth"
Not sure how OD wrapping up builtin version to yield correct Value property over an external file yet, tried cxtag basics but that returns just the cxtag itself.
RossYakulis wrote:Dates are tricky. If you use the "builtin" date type, please see here
https://www.w3.org/TR/voicexml20/#dmlABuiltins. Note:
"The set of accepted spoken input for each builtin type is platform dependent and will vary by language.
The value returned by a builtin type can be read out using the <say-as> element. VoiceXML extends <say-as> in [SSML] by adding 'interpret-as' values corresponding to each builtin type. These values take the form "vxml:<type>" where type is a builtin type. The precise rendering of builtin types is platform-specific and will vary by language.
date Valid spoken inputs include phrases that specify a date, including a month day and year. DTMF inputs are: four digits for the year, followed by two digits for the month, and two digits for the day. The result is a fixed-length date string with format yyyymmdd, e.g. "20000704". If the year is not specified, yyyy is returned as "????"; if the month is not specified mm is returned as "??"; and if the day is not specified dd is returned as "??". If the value is subsequently used in <say-as> with the interpret-as value "vxml:date", it will be spoken as date phrase appropriate to the current language."
I have attached the grammar used for english in simulation. This may not match the platform exactly.