Brat::Handler - Perl extension for managing Brat files.
use Brat::Handler;
$bratHandler = Brat::Handler->new();
$bratHandler->concat();
The module manages Brat files (<http://brat.nlplab.org/> - Brat aims at annotating text files with entities and relation).
The list of loaded files is indicated in the attribute inputFiles. Annotations are stored in the attribute bratannotations.
inputFiles
bratannotations
Brat::Handler::new();
This method creates a handler to manage several files and their annotations and returns the createed object.
$bratHandler->loadDir($inputDir);
The methods loads annotation files from the directory inputDir.
inputDir
$bratHandler->loadList($list);
The methods loads annotation files from the $list.
$list
$bratHandler->loadFile($file);
The methods loads annotation file specified in $file.
$file
The methods concatenates annotation files indicated in the field inputFiles.
$bratHandler->getTermList();
The method returns a string containing the list of entities of the loaded files, in the Alvis::TermTagger format.
Alvis::TermTagger
$bratHandler->getStats();
The method returns a string containing the statistics for all the loaded file.
$bratHandler->printTermList($filename, $mode);
The method prints a entity list in the Alvis::TermTagger format, in the file $filename. If the file is -, statistics are printed on the standard output.
$filename
-
$bratHandler->getRelationList();
The method returns a string containing the relations between two entities with the type of the relation. Separator is : .
:
$bratHandler->printRelationList($filename, $mode);
The method prints relations between two entities with the type of the relation in the file $filename. Separator is : . If the file is -, statistics are printed on the standard output.
$bratHandler->printStats($filename, $mode);
The method prints the statistics of all the loaded files in the file $filename. If the file is -, statistics are printed on the standard output.
http://brat.nlplab.org/
Thierry Hamon <hamon@limsi.fr>
Copyright (C) 2015 by Thierry Hamon
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Brat::Handler, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Brat::Handler
CPAN shell
perl -MCPAN -e shell install Brat::Handler
For more information on module installation, please visit the detailed CPAN module installation guide.