-
-
27 Jul 2017 20:57:50 UTC
- Distribution: Brat-Handler
- Module version: 0.11
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (521 / 0 / 46)
- Kwalitee
Bus factor: 0- 61.88% Coverage
- License: perl_5
- Perl: v5.10.0
- Activity
24 month- Tools
- Download (18.28KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Thierry Hamon
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
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 attributebratannotations
.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.
Module Install Instructions
To install Brat::Handler, copy and paste the appropriate command in to your terminal.
cpanm Brat::Handler
perl -MCPAN -e shell install Brat::Handler
For more information on module installation, please visit the detailed CPAN module installation guide.