mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
minibar: documentation fixes
This commit is contained in:
@@ -19,6 +19,21 @@ dl.apiexamples>dd { white-space: pre; }
|
|||||||
div.modtime { float: right; }
|
div.modtime { float: right; }
|
||||||
.modtime { color: #666; white-space: nowrap; }
|
.modtime { color: #666; white-space: nowrap; }
|
||||||
|
|
||||||
|
@media projection {
|
||||||
|
div.intro { display: none; }
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-size: 150%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 { page-break-before: always; }
|
||||||
|
|
||||||
|
dl.apiexamples dd {
|
||||||
|
page-break-after: always;
|
||||||
|
/*border-style: none;*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -102,16 +117,16 @@ full API.
|
|||||||
...
|
...
|
||||||
]
|
]
|
||||||
<dt class=js><em>// Parse a string</em>
|
<dt class=js><em>// Parse a string</em>
|
||||||
<br>server.parse({from:"FoodEng",input:"that pizza is very boring"},callback)
|
<br>server.parse({from:"FoodsEng",input:"that pizza is very boring"},callback)
|
||||||
<dt>http://localhost:41296/grammars/Foods.pgf?command=parse&input=that+pizza+is+very+boring&from=FoodsEng
|
<dt>http://localhost:41296/grammars/Foods.pgf?command=parse&input=that+pizza+is+very+boring&from=FoodsEng
|
||||||
<dd>[{"from":"FoodsEng",
|
<dd>[{"from":"FoodsEng",
|
||||||
"brackets":{"cat":"Comment","fid":10,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"cat":"Quality","fid":9,"index":0,"children":[{"token":"very"},{"cat":"Quality","fid":8,"index":0,"children":[{"token":"boring"}]}]}]},
|
"brackets":{"cat":"Comment","fid":10,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"cat":"Quality","fid":9,"index":0,"children":[{"token":"very"},{"cat":"Quality","fid":8,"index":0,"children":[{"token":"boring"}]}]}]},
|
||||||
"trees":["Pred (That Pizza) (Very Boring)"]}]
|
"trees":["Pred (That Pizza) (Very Boring)"]}]
|
||||||
<dt class=js><em>// Translate to all available languages</em>
|
<dt class=js><em>// Translate to all available languages</em>
|
||||||
<br>server.translate({from:"FoodEng",input:"that pizza is very boring"},callback)
|
<br>server.translate({from:"FoodsEng",input:"that pizza is very boring"},callback)
|
||||||
<dd>...
|
<dd>...
|
||||||
<dt class=js><em>// Translate to one language</em>
|
<dt class=js><em>// Translate to one language</em>
|
||||||
<br>server.translate({input:"that pizza is very boring", from:"FoodEng", to:"FoodSwe"}, callback)
|
<br>server.translate({input:"that pizza is very boring", from:"FoodsEng", to:"FoodsSwe"}, callback)
|
||||||
<dt>http://localhost:41296/grammars/Foods.pgf?command=translate&input=that+pizza+is+very+boring&from=FoodsEng&to=FoodsSwe
|
<dt>http://localhost:41296/grammars/Foods.pgf?command=translate&input=that+pizza+is+very+boring&from=FoodsEng&to=FoodsSwe
|
||||||
<dd>[{"from":"FoodsEng",
|
<dd>[{"from":"FoodsEng",
|
||||||
"brackets":{"cat":"Comment","fid":10,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"cat":"Quality","fid":9,"index":0,"children":[{"token":"very"},{"cat":"Quality","fid":8,"index":0,"children":[{"token":"boring"}]}]}]},
|
"brackets":{"cat":"Comment","fid":10,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"cat":"Quality","fid":9,"index":0,"children":[{"token":"very"},{"cat":"Quality","fid":8,"index":0,"children":[{"token":"boring"}]}]}]},
|
||||||
@@ -121,7 +136,7 @@ full API.
|
|||||||
[{"to":"FoodsSwe",
|
[{"to":"FoodsSwe",
|
||||||
"text":"den där pizzan är mycket tråkig"}]}]}]
|
"text":"den där pizzan är mycket tråkig"}]}]}]
|
||||||
<dt class=js><em>// Get completions (what words could come next)</em>
|
<dt class=js><em>// Get completions (what words could come next)</em>
|
||||||
<br>server.complete({from:"FoodEng",input:"that pizza is very "},callback)
|
<br>server.complete({from:"FoodsEng",input:"that pizza is very "},callback)
|
||||||
<dt>http://localhost:41296/grammars/Foods.pgf?command=complete&input=that+pizza+is+very+&from=FoodsEng
|
<dt>http://localhost:41296/grammars/Foods.pgf?command=complete&input=that+pizza+is+very+&from=FoodsEng
|
||||||
<dd>[{"from":"FoodsEng",
|
<dd>[{"from":"FoodsEng",
|
||||||
"brackets":{"cat":"_","fid":0,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"token":"very"}]},
|
"brackets":{"cat":"_","fid":0,"index":0,"children":[{"cat":"Item","fid":7,"index":0,"children":[{"token":"that"},{"cat":"Kind","fid":6,"index":0,"children":[{"token":"pizza"}]}]},{"token":"is"},{"token":"very"}]},
|
||||||
@@ -130,7 +145,7 @@ full API.
|
|||||||
</dl>
|
</dl>
|
||||||
<hr>
|
<hr>
|
||||||
<div class=modtime><small>
|
<div class=modtime><small>
|
||||||
<!-- hhmts start --> Last modified: Wed Aug 3 17:19:59 CEST 2011 <!-- hhmts end -->
|
<!-- hhmts start --> Last modified: Sun Aug 21 10:52:43 CEST 2011 <!-- hhmts end -->
|
||||||
</small></div>
|
</small></div>
|
||||||
<address><a href="http://www.cse.chalmers.se/~hallgren/">TH</a></address>
|
<address><a href="http://www.cse.chalmers.se/~hallgren/">TH</a></address>
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ HTML file, you would normally include at least the following:
|
|||||||
<ul>
|
<ul>
|
||||||
<li><code>translations.clear()</code> is called when there no entered
|
<li><code>translations.clear()</code> is called when there no entered
|
||||||
text.
|
text.
|
||||||
<li><code>translations.translateFrom({from:<var>conc</var>,input:<var>string</code>})</code>
|
<li><code>translations.translateFrom({from:<var>conc</var>,input:<var>string</var>})</code>
|
||||||
is called when the user has entered some text. The <code>from</code>
|
is called when the user has entered some text. The <code>from</code>
|
||||||
property is the name of the concrete syntax and the <code>input</code>
|
property is the name of the concrete syntax and the <code>input</code>
|
||||||
property is the entered text.
|
property is the entered text.
|
||||||
@@ -226,7 +226,7 @@ should add to the user interface:
|
|||||||
<hr>
|
<hr>
|
||||||
<div class=modtime>
|
<div class=modtime>
|
||||||
<small class=modtime>
|
<small class=modtime>
|
||||||
HTML <!-- hhmts start --> Last modified: Thu Aug 11 17:14:37 CEST 2011 <!-- hhmts end -->
|
HTML <!-- hhmts start --> Last modified: Sun Aug 21 19:11:35 CEST 2011 <!-- hhmts end -->
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user