Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nathanathan
Created October 20, 2012 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanathan/3925079 to your computer and use it in GitHub Desktop.
Save nathanathan/3925079 to your computer and use it in GitHub Desktop.
How does language work?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Widget</title>
<style>
code {
display:block;
}
</style>
</head>
<body>
<h3>How Language works:</h3>
<ol>
<li><p>The user types a command in language that makes sense to them into a search box. Here are some examples:</p>
<p><code>generate an html form with name age and gender fields</code>
<code>draw a teapot</code>
<code>sum(1,2,3)</code></p></li>
<li><p>The command is parsed generating many possible interpretations. Each interpretation has a widget (i.e. a small webpage) attached to it that performs a corresponding function. For example, if the user's command was "draw a teapot" the interpretations might have widgets that display various teapot drawings and perhaps some that provide instructions how to draw a teapot.</p></li>
<li><p>The widgets are displayed to the user in a ranked list.The user can up-vote good interpretations and down-vote irrelevant interpretations to improve future rankings. In addition to votes, probability of occurance may also affect an interpration's ranking. </p></li>
<li><p>If none of the resulting interpretations are to the user's liking, they can add a new "language node" to the site that interprets their command as they intended. This is easily done using a query like <a href="/category/main?q=add+language+node" target="_blank">"add language node"</a>. Language nodes can be configured to interpret many commands or just a specific few. To get technical, the configuration is essentially a CFG production rule. This makes it possible to compose language nodes so commands like the following can be interpreted: <code>sum(1, difference(2,3))</code></p></li>
</ol>
</body>
</html>
{
"category": "main",
"components": [
"How does language work?"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment