summaryrefslogtreecommitdiff
path: root/src/www/minibar/example.html
blob: 5e7814b28bfe7ec80b5bcce228e4980762d116b9 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html> <head>
<title>PGF online server example</title>
<style type="text/css">
body { background: #ddd; }
h1, h2, h3, small, th { font-family: sans-serif; }
div.modtime { float: right; }
.modtime { color: #666; white-space: nowrap; }
</style>
<script type="text/JavaScript" src="../js/support.js"></script>
<script type="text/JavaScript" src="../js/pgf_online.js"></script>
<script type="text/JavaScript">

var server_options={
  grammars_url: "http://www.grammaticalframework.org/grammars/",
  grammar_list: ["Foods.pgf"]
}
var pgf_server = pgf_online(server_options);

function call_server() {
  pgf_server.parse({from:"FoodsEng",input:document.forms[0].input.value},
                   show_output)
}

function show_output(parsed) {
  document.getElementById("output").innerHTML=parsed[0].trees[0]
}

</script>

</head>

<body>
<h1>PGF online server example</h1>

<form onsubmit="call_server(); return false">
Input:
<input name=input size=50 value="this cheese is expensive">
<input type=submit value=Parse>

<p>
Output:
<span id=output></span>
</form>


<h2>Documentation</h2>
<ul>
  <li><a href="gf-web-api-examples.html">GF Web API examples</a>
</ul>

<hr>
<div class=modtime><small>
<!-- hhmts start -->Last modified: Tue Nov 20 13:42:21 CET 2012 <!-- hhmts end -->
  </small></div>
<address><a href="http://www.cse.chalmers.se/~hallgren/">TH</a></address>
</body> </html>