-
Notifications
You must be signed in to change notification settings - Fork 175
/
ghpages.html
35 lines (32 loc) · 847 Bytes
/
ghpages.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
26
27
28
29
30
31
32
33
34
35
<!doctype html>
<html>
<head>
<title>Demo of JuliusJS</title>
<script src="julius.js"></script>
</head>
<body>
Say something:
<div id="what-you-said"></div>
Note that my vocabulary is limited for this demo.
<script>
var julius = new Julius({
// log: true
});
julius.onrecognition = function(sentence) {
console.log('Sentence: ', sentence);
document.getElementById('what-you-said').innerHTML = sentence;
}
julius.onfirstpass = function(sentence) {
console.log('First pass: ', sentence);
}
julius.onfail = function() {
// This will throw its own Error
// console.error('fail');
}
// This will only log if you pass `log: true` in the options object
julius.onlog = function(log) {
console.log(log);
}
</script>
</body>
</html>