Log in Help
Homewiki 〉 code-repository

GATE Example Code

This is the page for example code. Feel free to add your own tested and documented code.
Don't forget to look first at the chapter GATE Embedded in the user guide.


  1. System property gate.home should be set to the gate installation directory.
  2. gate.jar and all libraries under gate/lib directory should be made available on classpath environment variable.

Another good source of examples are the tests in gate sources. You can find the list of all the tests in the method suite() of TestGate.java.


Embedding ANNIE (HTML | plain Java)

This class illustrates how to use ANNIE as a sausage machine in another application - put ingredients in one end (URLs pointing to documents) and get sausages (e.g. Named Entities) out the other end.

Batch Processing (HTML | plain Java)

This class demonstrates simple batch processing in GATE. It is a command-line program which runs a GATE application (created in the GUI and saved using "save application state") over one or more input files, and writes the results to corresponding output files

Goldfish example (HTML | plain Java) and Goldfish PR (HTML | plain Java); CREOLE XML file

This example is provided by Andrew Clive Golightly (acg4#cs.waikato.ac.nz). It illustrates yet another way to use the GATE functionality outside the GUI. See the provided README and sample input file for details

Overriding the Doc viewer: Java code (HTML | plain Java); CREOLE XML file

This class illustrates the minimal way to create a document viewer/editor that will be loaded in the GATE GUI alongside GATE's own viewer

Working with serial datastores (HTML | plain Java)

This example illustrates how to work with Serial datastores - save/read/delete documents and corpora

Working with WordNet (HTML | plain Java)

This example illustrates how to work with the WordNet API in GATE - query words, travserse hypernymy relations, etc.

Information Retrieval example (HTML | plain Java)

This example illustrates how to call the IR API in GATE - index a corpus, run a query, get results and scores, etc