[asterisk-speech-rec] Number: Semantic Interpretation

Hector Lopez hectorjlr at hotmail.com
Wed May 9 08:50:37 MST 2007


 
Hello.
 
I have a big problem, i try to add and return a value in a numeric spanish grammar, my grammar is:
------------------------- gram_tally.gram--------------------------------------------
#ABNF 1.0;language es-MX;mode voice;root $tally;tag-format <lumenvox/1.0>; 
 
$digitos = ("{S EY R OW:0}" {$="0"} | "{UW N OW:1}" {$="1"} | "{D OW S:2}" {$="2"} | "{T R EY S:3}" {$="3"} | "{K W AA T R OW:4}" {$="4"} | "{S IY N K OW:5}" {$="5"} | "{S EY Y S:6}" {$="6"} | "{S Y EY T EY:7}" {$="7"} | "{OW CH OW:8}" {$="8"} | "{N W EY BV EY:9}"{$="9"}) { $ = parseInt($) };
 
$dieces = "{D Y EY S:10}" {$="10"} | "{OW N S EY:11}" {$="11"} | "{D OW S EY:12}" {$="12"} | "{T R EY S EY:13}" {$="13"} | "{K AA T OW R S EY:14}" {$="14"} | "{K IY N S EY:15}" {$="15"} | "{D Y EY S IY S EY Y S:16}" {$="16"} | "{D Y EY S IY S Y EY T EY:17}" {$="17"} | "{D Y EY S Y OW CH OW:18}" {$="18"} | "{D Y EY S IY N W EY BV EY:19}" {$="19"};
 
$decimas = ("{B EY Y N T EY:20}" {$="20"} | "{T R EY Y N T AA:30}" {$="30"} | "{K W AA R EY N T AA:40}" {$="40"} | "{S IY N K W EY N T AA:50}" {$="50"} | "{S EY S EY N T AA:60}" {$="60"} | "{S EY T EY N T AA:70}" {$="70"} | "{OW CH EY N T AA:80}" {$="80"} |"{N OW BV EY N T AA:90}" {$="90"}){ $ = parseInt($) }[$digitos { $ += $digitos }]; 
 
$UnaDecena = $decimas | $dieces;$funcion = $UnaDecena;     
$tally = $funcion; ------------------------- gram_tally.gram--------------------------------------------
 
The Grammar Editor check this ok, I call with this dialplan
 
------------------------------ DialPlan ----------------------------------------------
[bloque-CMA]exten => s,1,SpeechActivateGrammar(gram_tally)exten => s,n,SpeechStart()exten => s,n,SpeechBackground(3documento)exten => s,n,SpeechDeactivateGrammar(gram_tally)exten => s,n,GotoIf($["${SPEECH(results)}" = "0"]?1:6)exten => s,n,Set(TALLY=${SPEECH_TEXT(0)})exten => s,n,Gotoif($[ "${SPEECH_SCORE(0)}" > "${THRESHOLD}" ]?10:8)exten => s,n,Macro(confirmar, "${TALLY}" )exten => s,n,GotoIf($["${CONFIRM}" = "no"]?1:10)------------------------------ DialPlan ----------------------------------------------
 
But when lumenvox return value the result is:
 
Executing Set("SIP/1000-ab508178", "TALLY=40 7") in new stack
 
I hope recived:
                 "TALLY=47"
 
Where is the problem? :( I take the example of "Semantic Interpretation by Example", can you help me please?
 
_______________________________________ Hector J. Lopez Rguez. Nextel: 52*25012*27
_________________________________________________________________
Prueba Live.com: donde tu mundo en línea se junta en un solo lugar- Noticias, deportes, clima y mucho más.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-speech-rec/attachments/20070509/7d0d5235/attachment.htm


More information about the asterisk-speech-rec mailing list