Skip to content

Scripts

cteichmann edited this page Mar 27, 2017 · 15 revisions

There are a number of shell scripts that automate common Alto tasks. These scripts can be downloaded here. In order for these scripts to work it is necessary that an environment variable called ALTO_JAR is set to the path for a .jar file for a recent Alto version, including dependencies. These can downloaded here or build with Maven.

The scripts and their use can be summarized as follows:

  • acc - Alto Codec Converter
    • used to convert the encoding of object in a file
    • usage is sh acc <inputfiles> [options]
    • for each input file an output file with the same name with ".conv" appended will be created overwriting existing files
    • it is assumed that every line in the input files is either empty or encodes an instance to be converted and written into the output file
    • the input codec must be specified using the --input-codec/-ic option
    • the output codec must be specified using the --output-codec/-oc option
    • further options can be listed using the --help option
  • agc - Alto Grammar Converter
    • used to convert between different encodings for grammars
    • usage is sh agc <inputfiles> [options]
    • if no input files are specified, then grammar is read from stdin
    • output is written to file if one is specified with option --output-file, otherwise it is written to stdout
    • input codec is determined, in this order, (a) from the --input-codec command-line argument if one is given, or (b) from the filename, if one is given and its extension can be resolved to an input codec
    • output codec is determined, in this order, (a) from the --output-codec command-line argument if one is given; (b) from the output file name if one was specified and its extension can be resolved to an output codec; (c) using the toString() method of the grammar object if no other output codec can be determined
    • more options can be seen using the --help option
  • alab - Alto Lab Task Runner
    • used to start tasks in Alto Lab
    • usage: sh alab [options] <task ID>
    • for more information see Alto Lab page
    • options can be seen using --help option
  • ape - Alto Parsing Evaluator
    • used to read an input file and parse it's contents into an output file
    • usage is sh ape <inputfiles> [options]
    • option --grammar/-g must be used to specify grammar to be used
    • input interpretations which are used must be specified with --input-interpretations / -I (use comma seperated list)
    • output interpretations must be specified with -O option use -Okey=value to specify an output interpretation name / codec to be used pair
    • use --out-corpus / -o to specify output file name
    • if output are parse trees --parseeval option can be used to also print parseeval scores to stdout
    • more options can be printed using --help
Clone this wiki locally