Home

Awesome

BrGram - a lexical-functional grammar fragment of Brazilian Portuguese

Author: Leonel F. de Alencar leonel.de.alencar@ufc.br Copyright (C) 2013-2018 Leonel F. de Alencar

License: Apache License Version 2.0, January 2004. For more information, visit https://www.apache.org/licenses/LICENSE-2.0

BrGramm is a computational grammar fragment of Brazilian Portuguese in the LFG formalism. It is implemented in the Xerox Linguistic Environment - XLE. To compile a parser from the grammar and parse sentences in Portuguese, you first need XLE:

http://www2.parc.com/isl/groups/nltt/xle/

You also need XFST to compile the source files of the basic tokenizer and the morphological analizer into finite-state transducers:

http://web.stanford.edu/~laurik/fsmbook/home.html

You can download the source files of both transducers from here:

https://github.com/LFG-PTBR/BrGram/fst

The finite-state transducers must be compiled with XFST in the operating system where you are running XLE. Edit the respective path in the morphology.lfg file to point to the location of each transducer file in your system.

Once you have XLE installed and the transducers compiled, you can compile a parser from the grammar by executing the following command on the XLE shell (I assume your working directory is the grammar folder):

create-parser config.lfg

To apply the parser on individual sentences from the testfile.lfg in the test folder, run:

parse-testfile testfile.lfg 1

where 1 refers to first sentence in the testfile.

For more details on the XLE textual and graphical user interfaces, see the documentation:

http://www2.parc.com/isl/groups/nltt/xle/doc/xle.html#SEC2

BrGramm is a significantly improved version of the grammar fragment described in the following papers:

Previous versions are described in the following introduction to LFG and grammar development in XLE:

For bug reports, comments, and suggestions, please issue the issues from GitHub repository.