List of Web Demos

Each demo has its own page, with a link to the demo on the web. The navigation bar to the left has a listing, as does the top-level demos page:

The rest of this page provides instructions for running the demos on the web.

Ways to Run the Web Demos

LingPipe's web demos may be accessed via HTTP via three different interfaces:

All three interfaces accept the same content types (HTML, XML and plain text) and specify input/output character set encodings in the same way:

Interface 1: Text Input Form

Text input is supported through an HTML form that contains a text input field. The text input form for a demo is available at:

http://lingpipe-demos.com:8080/lingpipe-demos/DemoName/textInput.html

where DemoName is the name of the demo; e.g. echo or sentence_en_news.

Text Input

Text may be entered directly into the input form by typing or any other platform-supported means such as cut-and-paste or special character input (e.g. for Chinese).

Parameter Input

Parameters with fixed sets of choices are entered using pull-down menus. Open-ended parameters are entered through small text fields.

Content Type

The content type for this input is the one expected from web text entry forms:

application/x-www-form-urlencoded

Browser Character Set

It is important for text input forms (but not other web demos) that the character set declared in a browser (IE, Firefox, Safari, etc.) be the same as that declared for input text. This step is required to allow cut-and-paste and direct input to be captured correctly by the browser before being sent as bytes to the web server.

Submitting Text and Parameters

After the text is entered and parameters are selected, pressing the submit button sends the text and parameters to the server as an appropriately formatted HTTP request.

Viewing Results

The server will return a page containing XML to the client, which the client will then display. Display behavior depends on the client.

Interface 2: File Upload Form

Text may be provided to the web demos by uploading a file through a form on the browser. The file upload form for a demo is available at:

http://lingpipe-demos.com:8080/lingpipe-demos/DemoName/fileInput.html

where DemoName is the name of the demo; e.g. echo or sentence_en_news.

Text Input

An absolute path to the file on the user's system may be entered directly, or the browse button may pressed in order to find the file using the platform's file browser.

Parameter Input

Parameters are entered using pull-down menus or by small text fields if they are open-ended.

Content Type

The content type for this input is the one expected from web file upload forms,

multipart/form-data

Submitting Text and Parameters

Pressing the submit button after the file is chosen and parameters are set causes the file to be sent as part of an HTTP request to the web server running the demo.

Viewing Results

The server will return a page containing XML to the client, which the client will then display. Display behavior depends on the client.

Interface 3: Web Service

LingPipe demos may be accessed directly as a web service through HTTP. Rather than using a form, a client program can directly send an HTTP request to the server. This can be done through an HTTP client in any language.

The web service version of a demo is available at:

http://lingpipe-demos.com:8080/lingpipe-demos/DemoName/response.xml

where DemoName is the name of the demo; e.g. echo or sentence_en_news.

Text Input

Text input should be provided as post data.

Parameter Input

Parameters should be URL encoded as part of the request URL. For more information on URL encoding, see the class documentation for java.net.URLEncoder.

Content Type

The request content type must be set to:

text/plain

If a character set is specified, it will be used to decode the text sent as a byte stream. The character set may also be specified as a parameter.

Content Types and Character Encodings

Input: Text, HTML or XML

The demos process data in one of three formats: plain text, HTML or XML. How that data is presented to the demo varies based on whether the demo is on the web, in a GUI, or a command.

Specifying Input Content Type

The content type of the input is specified using a control on the form called labeled contentType. It presents three values: text/plain (the initial value), text/html and text/xml

Specifying Elements to Annotate or Remove

For XML and HTML input, the elements to tag may be specified as a comma-separated list of element qualified names in the text field labeled includeElts. Another comma-separated list of names may be removed altogether from the input (though their content is left behind) in the text field labeled removeElts.

Output: XML

The demo output format is XML in all cases. Plain text is minimally wrapped in an element. HTML is parsed using NekoHTML into well-formed XML. XML is passed through with inline annotation.

Character Encoding

The web demos all require both input and output character sets to be specified. The web forms will initially show the default character set of the server's Java virtual machine. They will also show all of the other encodings available on the platform.

Specifying Character Encodings

Character encodings for the input and output are specified through pulldown menus labled inCharset and outCharset respectively.