answer.html

<!DOCTYPE html>
<html> <head>
<meta charset="UTF-8">
<title>Question answering demo</title>
<link rel=stylesheet type="text/css" href="/~hallgren/gf/src/www/minibar/minibar.css">
<style>
div.answer { font-size: 125%; background: #def; }
</style>
</head>

<body class=minibar>
<h1>Question answering demo</h1>

<div id="question_answer">
  <noscript>Enable JavaSscript to use this web app</noscript>
</div>

<h2>About this demo</h2>

Press space for word completion.
Press <kbd>Enter</kbd> after entering a number.
<p>
This demo was created by combining three parts:
<ul>
  <li><p>A GF grammar for math queries.
    (Abstract syntax:
  <a href="../Ex3/Query.gf">Query.gf</a> and
  <a href="../Ex3/MathQuery.gf">MathQuery.gf</a>,
  concrete syntax for English:
  <a href="../Ex3/QueryEng.gf">QueryEng.gf</a> and
  <a href="../Ex3/MathQueryEng.gf">MathQueryEng.gf</a>.)
  The grammar covers a small set of properties of numbers
  (smaller than, greater than, even, odd, prime, divisibility),
  conjunction, disjunction, negation, and quantification (all, any).
  You can ask if a property holds, for which numbers a property holds or
  for how many numbers a property holds. Examples:
  <ul>
    <li>which numbers smaller than 100 are prime
    <li>how many prime numbers are even
    <li>is 607 prime
  </ul>
  
  <li><p>A Haskell program (<a href="../Ex3/Answer.hs">Answer.hs</a>
  and generated by GF: <a href="../Ex3/MathQuery.hs">MathQuery.hs</a>)
  that interprets the queries and computes answers.
  To ensure termination, only a finite subset of the natural numbers
  is considered (currently [0..1000]). This also means that some questions
  have surprising answers (e.g. which numbers are greater than all prime
  numbers).
  
  <li><p>JavaScript components from <a href="http://cloud.grammaticalframework.org/minibar/minibar-api.html">the Minibar</a> for guided input of queries.
  The parts are combined and initialized in
  <a href="../../js2html.cgi/Tutorial2012/Ex4/answer.js">answer.js</a>.
</ul>

<hr>
<div class=modtime><small>
<!-- hhmts start -->Last modified: Wed Nov 21 19:16:08 CET 2012 <!-- hhmts end -->
</small></div>
<address><a href="http://www.cse.chalmers.se/~hallgren/">TH</a></address>
</body>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/js/support.js"></script>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/js/localstorage.js"></script>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/js/pgf_online.js"></script>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/minibar/minibar_support.js"></script>
<script type="text/JavaScript" src="/~hallgren/gf/src/www/minibar/minibar_input.js"></script>
<script type="text/JavaScript" src="answer.js"></script>
<script type="text/JavaScript">
start("/grammars/apps/","MathQuery.pgf")
</script>
</html>

Generated by GNU Enscript 1.6.5.90.