About the Echo Demo

The echo demo merely returns the text it is given. Even though this is the simplest possible implementation of LingPipe's demo framework, it is useful because of features built into the general framework.

Character Transcoding

Because the input and output character sets may be specified, the echo demo may be used to convert one character set to another.

HTML Normalization

Because any input HTML is normalized into valid XHTML by the NekoHTML parser, the echo demo may be used to normalize HTML to XHTML.

Echo Demo on the Web

The echo demo is hosted on the web at the following URL:

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

For detailed information about using web demos, including web form, file upload and web service instructions, see the web demo instructions

Echo Demo via GUI

To launch the echo demo in a GUI, first change directories to the command directory and then invoke the demo batch script. Note: Parameters are set in the GUI, not as arguments to the launch script.

Windows Operating System

> cd %LINGPIPE_HOME%\demos\generic\bin
> gui_echo.bat 

Unix-like Operating Systems

> cd $LINGPIPE_HOME/demos/generic/bin
> sh gui_echo.sh

For detailed information about running demos in a GUI, see the GUI demo instructions

Echo Demo via Shell Command

Shell commands may be run over single files, all of the files in a directory, or using standard input/output.

Running over a Directory

> cd $LINGPIPE/demos/generic/bin
> cmd_echo.bat -inDir=../../data/testdir -outDir=/testout

Running a Single File

> cd $LINGPIPE/demos/generic/bin
> cmd_echo.bat -inFile=../../data/testdir/foo.txt -outFile=foo.out.xml

Running through a Pipe (Standard input/output)

> cd demos/generic/bin
> echo See Spot. See Spot run. | cmd_echo.bat

Running in Unix-like Operating Systems

For unix-like operating systems such as Unix, Solaris, Linux, or Macintosh OS X:

For detailed information about running demos from the command line, see the command line demo instructions

Echo Demo Scripts

The following scripts are available in $LINGIPE/demos/generic/bin for running the demo. Note that each script comes in four flavors, distinguishing command line from GUI, and the Windows DOS shell from the Unix shell.

Language Genre Mode Windows DOS Unix/Linux/Mac sh
Universal Command cmd_echo.bat cmd_echo.sh
GUI gui_echo.bat gui_echo.sh

Echo Demo Parameters

The following is a complete list of parameters for the demo.

General Demo Parameters

These parameters apply to every version (web/GUI/command) of every demo.

Parameter Description Usage Constraints
inCharset Input character set Optional. Defaults to platform default.
outCharset Output character set
contentType Input content type May be one of:
  • text/plain
  • text/html
  • text/xml
Defaults to text/plain.
removeElts Element tags to remove Optional. May only be used with contentType=text/html or contentType=text/xml. Each value may be comma-separated list. If neither of these are specified, all text content is processed.
includeElts Elements to annotate

Command-Line Only Parameters

These parameters apply to every command-line demo, but are not relevant for the GUI or web versions of the demos.

Parameter Description Usage Constraints
inFile Readable input file May not be used with inDir. If either is not specified, defaults to standard input or output.
outFile Writeable output file
inDir Readable input directory May not be used with inFile or outFile. If used, inDir and outDir must both be specified.
outDir Writeable output directory