Grew main page

Running Grew

There are 3 main running modes for Grew:

  • GUI mode (this is the default mode): grew
  • Deterministic mode for one-to-one graph transformation: grew -det
  • Corpus mode runs grew on a set of input graphs (see details below): grew -corpus

Options for all modes

  -grs <grs_file>              chose the grs file to load
  -seq <seq>                   set the module sequence to use
  -timeout <float>             set a timeout on rewriting
  -main_feat <feat_name_list>  set the list of feature names used in dep format to set the "main word"

If an option is not set, grew tries to recover the last used values.

The GUI mode

The following option is available only for the GUI mode:

  -gr <gr_file>             set the graph file (.gr or .conll) to use
  -doc                      force to generate the GRS doc

The documentation generation take some time (about 20 seconds for synsem_ftb) and it is disable by default. The documentation given in the GUI can be outdated if the GRS has changed since the last documentation generation.

The deterministic mode

When the GRS file describes a one-to-one transformation, the -det option can be used to transform all graph of a corpus.

The two commands below rewrite each graph found in input (either a conll file or a directory). The output is written in a file (first command) or in a directory (second command).

grew -det -i input -f output_file 
grew -det -i input -o output_dir 

NB: One way to ensure that a GRS is deterministic is to declare all modules as confluent (at most one normal form) and to avoid filter rules (at least one normal form).

The corpus mode

The corpus mode runs some GRS on a set of graphs. This mode produces a directory which contains:

  • a file index.html with a table of modules and rules usage statistics;
  • a GRS documentation in the doc subdir;
  • optionally (with option -html or -full_html) an html file f.html for each graph of f.conll of the input corpus;
  • optionally (with option -out_gr) a gr file for each normal forms obtained.

There are two required options for this mode:

  -i <input_dir>            set the input dir where to find graph files (.gr or .conll) in corpus mode
  -o <output_dir>           set the output dir where to generate statistics and documentation in corpus mode

WARNING If some directory of some file named output_dir exists, it will be erased.

Other options available for corpus mode are:

  -title                    set the title for the generated page of statistics
  -html                     generate html files for each rewritten sentence
  -full_html                generate html files for each sentence of the corpus
  -out_gr                   generate gr output for each rewriting normal form of the corpus
  -no_init                  do not display initial graph (requires html of full_html)

WARNING options -html, -full_html or -out_gr can produce an high number of files if there are applied on a large corpus.