The system allows a user to specify a synchronous multicomponent tree-adjoining grammar (STAG) using an intuitive, text-based metagrammar. It then automates the specified derivations and outputs the derived trees.
This README is only meant to get you started. Refer to doc/mctagdoc.pdf
for in-depth documentation. These slides may also be helpful.
You will need OCaml 4.02 (or later) and Menhir. Refer to the OCaml docs for installation instructions. If you install the package manager OPAM with OCaml (highly recommended), Menhir can be installed with the following command:
opam install menhir
You may compile the files with your favorite OCaml compiler, but I suggest OCamlbuild, which can be installed with the following command:
opam install ocamlbuild
To build all the files for the first time, run the following command:
ocamlbuild -use-menhir mctag.byte
This command creates a _build
directory within your current working directory. The executables will be stored there, but a symlink should be created in your current directory. If you can't find the target mctag.byte
file, look under _build
.
To help the user get off the ground, the repo contains several sample grammars in the grammars
folder. Try running
./mctag.byte -i grammars/toy.txt
to print the derived syntax and semantics trees for the sentence 'John saw a girl'.
A full list of example grammars is provided below.
Path | Description |
---|---|
grammars/toy.txt |
'John saw a girl' |
grammars/example.txt |
Reflexives, topicalization, quantifier scope ambiguity, adjunction at substitution nodes, etc. |
grammars/paper.txt |
Trees from Aggazzotti & Shieber (2017) |
grammars/features.txt |
Basic analyses of features -- see doc for more details |
You can specify your own STAGs using the metagrammar specified in the full documentation under doc/mctagdoc.pdf
.
This system was developed in collaboration with Stuart Shieber and Cristina Aggazotti during the summer of 2016.