APE - ACE Parsing Engine

Authors: Kaarel Kaljurand, Norbert E. Fuchs, Tobias Kuhn

Last update: 2008-04-09

Introduction

This document explains how APE (ACE Parsing Engine) is compiled and used.

In order to compile and run APE, you need to install a recent version of SWI Prolog. SWI Prolog is free software and can be downloaded from http://www.swi-prolog.org/.

Compilation

Before you can run APE, you have to compile the code. Just execute the file make_exe.bat in the case of Windows or make_exe.sh in the case of Mac OS X, Linux, or any other Unix system. Both files are located in the root directory of the APE distribution. After you have done this, there should be a new file ape.exe.

Execution

APE has to be executed from the commandline. In the commandline terminal, go to the root directory of APE (where ape.exe is located). Then type ape.exe in the case of Windows or ./ape.exe otherwise. If everything went well, you should get something like this:

  Attempto Parsing Engine for ACE 6.0
  Copyright 2008 Attempto Group, University of Zurich
  This program comes with ABSOLUTELY NO WARRANTY.
  This is free software, and you are welcome to redistribute it under certain conditions.
  Please visit http://attempto.ifi.uzh.ch for details.
  
  Command-line arguments:
  -text "TEXT"     The input ACE text. If neither -text nor -file is present then the ACE text is read from stdin.
  -file FILENAME   The input file containing the ACE text.
  -ulex FILENAME   The user lexicon file to be loaded.
  -solo OUTPUT     Output just one output component. OUTPUT has to be one of {paraphrase,paraphrase1,paraphrase2,owlfss,owlrdf,owlxml,
                   fol,pnf,tokens,syntax,drs,drsxml,drspp,drshtml,syntaxpp}.
  -cdrs            Output the DRS as a Prolog term.
  -cdrsxml         Output the DRS in XML.
  -cdrspp          Output the DRS in pretty-printed form.
  -cdrshtml        Output the DRS in pretty-printed form in HTML.
  -cparaphrase     Output a paraphrase which is a "best-effort" combination of paraphrase1 and paraphrase2.
  -cparaphrase1    Output a paraphrase which uses full sentences instead of relative clauses.
  -cparaphrase2    Output a paraphrase which uses relative clauses instead of full sentences.
  -ctokens         Output tokens as a Prolog list of lists.
  -csentences      Output sentences as a Prolog list.
  -csyntax         Output syntax trees as a Prolog list.
  -csyntaxpp       Output syntax trees in pretty-printed form.
  -cowlfss         Output OWL 2/SWRL in the Functional-Style Syntax representation.
  -cowlrdf         Output OWL 2/SWRL in the RDF/XML representation.
  -cowlxml         Output OWL 2 in the XML representation (but in case of SWRL use RDF/XML).
  -cfol            Output standard first-order logic representations (default form and prenex normal form) of the DRS as a Prolog term.
  -uri URI         URI for the OWL outputs.
  -guess           Guess the word-class of unknown words.
  -help            Shows this help page.

This description explains how to use the ape.exe command. For example, the following command parses the text "John waits." and outputs the DRS in XML representation and the syntax tree:

  ./ape.exe -text "John waits." -cdrsxml -csyntax

In the case of Windows, you have to omit the first two characters "./". The next example parses the text that is inside of the file ace.txt and outputs the OWL FSS representation:

  ./ape.exe -file ace.txt -solo owlfss

If you omit both arguments, text and file, the ACE text is read from the standard input:

  echo "Every mammal is an animal." | ./ape.exe -solo drspp

Note that this does not work under Windows.

If you just execute the line

  ./ape.exe -solo drspp

then the terminal waits for an input. In this case, you can type your ACE text into the terminal window. Once you have done so, press Enter and Ctrl-D to tell the terminal that you are finished. The output (the pretty printed DRS in our case) is then shown below the ACE text you just entered. Again, this does not work under Windows.

Code

The APE code is divided into four packages:

  logger/
  lexicon/
  utils/
  parser/

This listing reflects the dependencies: logger depends on no other package. lexicon depends only on logger. The package utils depends only on logger and utils. The package parser, finally, depends on all three other packages. The files in the root directory depend on those packages, but not vice versa.

For more information consult the commented source files.