This directory contains a few examples on how to use the Okapi library with your own Java programs.
The examples have been pre-compiled. You can execute them by running
run_examples.bat
(Windows) or run_examples.sh
(Linux and Macintosh).
Make sure to have the examples in a directory where you have write-rights.
If you wish to modify and re-compile the examples:
build_examples.bat
(Windows) or build_examples.sh
(Linux and Macintosh).This example shows how to create and execute a pipeline with three or four steps:
You can choose to run both middle steps or just one of them from the command-line option.
This example takes a properties file or an OpenOffice.org
document and print to the console all translatable text. The inline codes
inside the text are displayed with generic markers such as: <1>
...</1>
,
<2/>
.
This example takes a file test.xml
(complied into the jar,
but you can see it in the src
directory) and runs a pipeline
with four steps:
The first step takes the input document and processes it with a first XSLT template that just re-create the input to an output.
The second step takes the output f the first one, and
processes with a second XSLT template that removes <b>
nodes.
The third step takes the output of the second one and converts the document into filter events, using the XML filter.
The fourth step takes the filter events sent by the third step and create an output stream. Then that output is displayed on the standard output.
This example shows some of the functionality provided by the segmenter
included in the Okapi Library. It uses the myRules.srx
SRX
file included in the sample files to segment some example text.
This example shows how to use some of the TM and MT query connectors that are provided with the Okapi Library. The first part demonstrates the Apertium MT server. The second part shows how to query the Amagama TM server. Both have public servers that should be accessible to everyone running the demo.