We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

allow user to naturally speak a year

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
jverweij
Posts: 79
Joined: Thu Apr 27, 2017 11:29 am

allow user to naturally speak a year

Post by jverweij »

Hi
We have a prompt in our IVR that asks the user to say or enter on the keypad their year of birth . We are not able to get the spoken year of birth to be recognized unless the user says it as individual digits. For example, saying 1968 as "nineteen sixty eight" is not recognized. But saying "one nine six eight" is. How can we get the IVR to accept the year of birth in a way that a user is more inclined to provide?
thanks

admin
Site Admin
Posts: 35
Joined: Thu May 29, 2003 3:12 pm

Re: allow user to naturally speak a year

Post by admin »

Hi,

Unfortunately there is no built-in grammar that allows user to say the birth year in a more conversational format. We highly recommend allowing only DTMF inputs as a more efficient means of collecting the year. Yet if you wish to include ASR grammar, custom grammar could be built to support various inputs. The sample code below allows for different permutations of year input.

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
	<form id="start">
		<field name="year">
			<grammar root="main" type="application/srgs+xml" mode="voice">
				<rule id="main" scope="public">
					<item>
						<ruleref uri="#hundreds"/>
						<ruleref uri="#join"/>
						<ruleref uri="#tens"/>
					</item>
					<tag> 
						hundreds = hundreds.SWI_literal; tens = tens.SWI_literal;
						year = hundreds + tens;
					</tag>
				</rule>
				
				<rule id="hundreds">
					<one-of>
            <item>19</item>
            <item>20</item>
            <item>2000</item>
          </one-of>
        </rule>
				
				<rule id="join">
					<item repeat="0-1">and</item>
				</rule>
				
				<rule id = 'tens'>
					<one-of>
						<item>1</item>
						<item>2</item>
						<item>3</item>
						<item>4</item>
						<item>5</item>
						<item>6</item>
						<item>7</item>
						<item>94</item>
					</one-of>
				</rule>
				
			</grammar>
		
			<prompt> Please enter your birth year </prompt>

			<filled>
				<prompt> You said <value expr="year"/> </prompt>
			</filled>
		</field>
	</form>
</vxml>
Regards,
Plum Support

Post Reply