Thierry Hamon
and 1 contributors

NAME

Brat::Handler - Perl extension for managing Brat files.

SYNOPSIS

use Brat::Handler;

$bratHandler = Brat::Handler->new();

$bratHandler->concat();

DESCRIPTION

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.

METHODS

new()

    Brat::Handler::new();

This method creates a handler to manage several files and their annotations and returns the createed object.

loadDir()

    $bratHandler->loadDir($inputDir);

The methods loads annotation files from the directory inputDir.

loadList()

    $bratHandler->loadList($list);

The methods loads annotation files from the $list.

loadFile()

    $bratHandler->loadFile($file);

The methods loads annotation file specified in $file.

concat()

    $bratHandler->concat();

The methods concatenates annotation files indicated in the field inputFiles.

getTermList()

    $bratHandler->getTermList();

The method returns a string containing the list of entities of the loaded files, in the Alvis::TermTagger format.

getStats()

    $bratHandler->getStats();

The method returns a string containing the statistics for all the loaded file.

printTermList()

    $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.

getRelationList()

    $bratHandler->getRelationList();

The method returns a string containing the relations between two entities with the type of the relation. Separator is : .

printRelationList()

    $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.

printStats()

    $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.

SEE ALSO

http://brat.nlplab.org/

AUTHORS

Thierry Hamon <hamon@limsi.fr>

LICENSE

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.