-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
25 lines (24 loc) · 870 Bytes
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="jquery-speechreconize.js"></script>
<body>
<script type="text/javascript">
var WORDS =
{
'EAGGER_1': [ 'coucou' ],
'TO_LEAVE': [ 'partir', 'pars', 'reviens' ],
'DURATION_DAY': [ 'jour', 'jours', 'journée' ],
'DURATION_WEEK': [ 'semaine', 'semaines' ],
'NUMBERS': { '1': [ 'un', 'une' ], '2': [ 'deux' ], '3': [ 'trois ' ], '4': [ 'quatre' ] }
};
var SENTENCES =
[
{ text: '^EAGGER_1$', action: function() { alert('Coucou les amis !'); } },
{ text: '^TO_LEAVE ([0-9]+) (DURATION_DAY|DURATION_WEEK)$', action: function(m) { alert('Bonne semaine !'); } }
];
$(document).SpeechReconize(SENTENCES, WORDS, 'coucou');
$(document).SpeechReconize(SENTENCES, WORDS, 'je pars une semaine');
</script>
</body>
</html>