Revision: 6564 http://languagetool.svn.sourceforge.net/languagetool/?rev=6564&view=rev Author: dnaber Date: 2012-03-04 09:53:59 +0000 (Sun, 04 Mar 2012) Log Message: ----------- improve wording and layout; document --port option and "/Languages" URL
Modified Paths: -------------- trunk/website/www/usage/index.php Modified: trunk/website/www/usage/index.php =================================================================== --- trunk/website/www/usage/index.php 2012-03-03 18:32:33 UTC (rev 6563) +++ trunk/website/www/usage/index.php 2012-03-04 09:53:59 UTC (rev 6564) @@ -2,42 +2,44 @@ $page = "usage"; $title = "LanguageTool"; $title2 = "Usage"; -$lastmod = "2012-02-08 20:20:00 CET"; +$lastmod = "2012-03-04 20:20:00 CET"; include("../../include/header.php"); include('../../include/geshi/geshi.php'); ?> <p>LanguageTool can be used in a different number of ways:</p> -<h3>As a LibreOffice/OpenOffice.org extension</h3> - Double click the downloaded <tt>LanguageTool-1.x.oxt</tt> to install it. + +<h2>As a LibreOffice/OpenOffice.org extension</h2> + <p>Double click the downloaded <tt>LanguageTool-1.x.oxt</tt> to install it. If that doesn't work, call <em>Tools -> Extension Manager -> Add...</em>. Close LibreOffice/OpenOffice.org and re-start it. Type some text with an error that LanguageTool can detect and you should see a blue underline. You might want to use "This is an test." as en example – make sure the text language is set - to English for this example. + to English for this example.</p> -<h3>As a stand-alone application</h3> - Rename the *.oxt file so it ends with ".zip" and unzip it. + +<h2>As a stand-alone application</h2> + <p>Rename the *.oxt file so it ends with ".zip" and unzip it. Then start <tt>LanguageToolGUI.jar</tt> by double clicking on it. If your computer isn't - configured to start jar archives, start it from the command line using<br /> - <tt>java -jar LanguageToolGUI.jar</tt><br /> - You can use the <tt>--tray</tt> option to start LanguageTool inside the system tray. + configured to start jar archives, start it from the command line using:</p> + <tt>java -jar LanguageToolGUI.jar</tt> + + <p>You can use the <tt>--tray</tt> option to start LanguageTool inside the system tray. After you copy any text to the clipboard, clicking LanguageTool in the system tray will cause the application to open and check the contents of the clipboard automatically. This way - you can use LanguageTool for applications that do not support direct integration of the checker. + you can use LanguageTool for applications that do not support direct integration of the checker.</p> -<h3>As a stand-alone application on the command line</h3> - See above, but start LanguageTool.jar using<br /> - <tt>java -jar LanguageTool.jar <filename></tt><br /> - LanguageTool only supports plain text files. -<h3>Embedding LanguageTool in Java applications</h3> -See - <?=show_link("the API documentation", "/development/api/", 0) ?>. You just need to create a - <tt>JLanguageTool</tt> object and use that - to check your text. For example: - <br /><br /> +<h2>As a stand-alone application on the command line</h2> + <p>See above, but start LanguageTool.jar using:</p> + <tt>java -jar LanguageTool.jar <filename></tt> + <p>LanguageTool only supports plain text files.</p> + + +<h2>Embedding LanguageTool in Java applications</h2> + <p>You just need to create a <tt>JLanguageTool</tt> object and use that + to check your text. Also see <?=show_link("the API documentation", "/development/api/", 0) ?>. For example:</p> <?php hljava('JLanguageTool langTool = new JLanguageTool(Language.ENGLISH); langTool.activateDefaultPatternRules(); @@ -52,23 +54,25 @@ }'); ?> <br /> -<h3>Using LanguageTool from other applications</h3> -Start the stand-alone - application and configure it to listen on a port that is not used yet (the default - port, 8081, should often be okay). This way LanguageTool will run in server mode - until you stop it. <br /> - The client that wants to use LanguageTool can now send its text to an URL like this:<br /> - <tt>http://localhost:8081/?language=xx&text=my+text</tt><br /> - The <tt>language</tt> parameter must specify the two-character language code +<h2>Using LanguageTool from other applications</h2> + + <p>Start the stand-alone + application and configure it (<em>File -> Options...</em>) to listen on a port that is not used yet (the default + port, 8081, should often be okay). This way LanguageTool will also be available in server mode + until you stop it. The client that wants to use LanguageTool can now send its text to an URL like this:</p> + + <tt>http://localhost:8081/?language=xx&text=my+text</tt><br /> + + <p>The <tt>language</tt> parameter must specify the two-character language code of the text to be checked. You can also specify <tt>motherTongue</tt> parameter to specify your mother tongue (for false friend checks). The <tt>text</tt> parameter is the - text itself (you may need to encode it for URLs). If you want to test bilingual text (containing - source and translation), simply specify also <tt>srctext</tt> parameter. This way bitext mode will be - automatically activated. - You can use both POST and GET to send your requests to the LanguageTool server.<br /> - For the input "this is a test" the LanguageTool server will reply with this - XML response:<br/><br/> + text itself - you may need to encode it for URLs. If you want to test bilingual text (containing + source and translation), simply specify also the <tt>srctext</tt> parameter. This way bitext mode will be + activated automatically. You can use both POST and GET to send your requests to the LanguageTool server.</p> + + <p>For the input "this is a test" the LanguageTool server will reply with this + XML response:</p> <?php hl('<?xml version="1.0" encoding="UTF-8"?> <matches> @@ -79,9 +83,16 @@ contextoffset="0" errorlength="4"/> </matches>'); ?> + + <p>You can call <tt>http://localhost:8081/Languages</tt> to get a list of all languages available.</p> - <p>The server can also be started on the command line using this command:<br /> - <tt>java -cp LanguageTool.jar org.languagetool.server.HTTPServer</tt></p> + <p>The server can also be started in a server-only mode (no GUI) on the command line using this command:</p> + <tt>java -cp LanguageTool.jar org.languagetool.server.HTTPServer</tt> + <p>You can use the <tt>--port</tt> or <tt>-p</tt> option to specify the port number. If + no port number is specified, the default (8081) is used. For security reasons, the server will + not be accessible from other hosts. If you want to run a server for remote users you will + need to write a small Java program that creates an instance of + <tt><a href="http://www.languagetool.org/development/api/index.html?org/languagetool/server/HTTPServer.html">org.languagetool.server.HTTPServer</a></tt>.</p> <?php include("../../include/footer.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Languagetool-cvs mailing list Languagetool-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/languagetool-cvs