File Coverage

blib/lib/Lingua/BioYaTeA.pm
Criterion Covered Total %
statement 25 33 75.7
branch 4 6 66.6
condition 1 3 33.3
subroutine 6 6 100.0
pod 2 2 100.0
total 38 50 76.0


line stmt bran cond sub pod time code
1             package Lingua::BioYaTeA;
2              
3 5     5   175894 use strict;
  5         15  
  5         221  
4 5     5   31 use warnings;
  5         10  
  5         165  
5 5     5   17463 use utf8;
  5         62  
  5         37  
6              
7             =encoding utf8
8              
9             =head1 NAME
10              
11             Lingua::BioYaTeA - Perl extension of Lingua::YaTeA for extracting terms from a biomedical corpus.
12              
13             =head1 SYNOPSIS
14              
15             use Lingua::BioYaTeA;
16              
17             my %config = Lingua::YaTeA::load_config($rcfile);
18              
19             $yatea = Lingua::YaTeA->new($config{"OPTIONS"}, \%config);
20              
21             $corpus = Lingua::YaTeA::Corpus->new($corpus_path,$yatea->getOptionSet,$yatea->getMessageSet);
22              
23             $yatea->termExtraction($corpus);
24              
25              
26             =head1 DESCRIPTION
27              
28             This module is the main module of the software BioYaTeA which is an
29             adaptation of YaTeA (C) for biomedical text.
30              
31             The module inherits from all the class and attributes of
32             C. The input and output files but also the
33             configuration files follow the same format as YaTeA.
34             The tuning concerns the configuration files (in the directory
35             C.
36              
37             Default configuration is assumed to be C.
38              
39             For the use of BioYaTeA, see the documentation with the script
40             C.
41              
42             =head1 METHODS
43              
44             =head2 new()
45              
46             new($command_line_options_h,$system_config_h);
47              
48             The methods creates a new term extractor and sets options from the
49             command line (C<$commend_line_options_h>) and options defined in the
50             hashtable (C<$system_config_h>) given by address. The methods returns
51             the created object.
52              
53             =head2 load_config()
54              
55             load_config($rcfile);
56              
57             The method loads the configuration of the NLP Platform by reading the
58             configuration file given in argument. It returns the hashtable
59             containing the configuration.
60              
61              
62             =head1 SEE ALSO
63              
64             Documentation of Lingua::YaTeA
65              
66             =head1 AUTHORS
67              
68             Wiktoria Golik , Zorana Ratkovic , Robert Bossy , Claire Nédellec , Thierry Hamon
69              
70             =head1 LICENSE
71              
72             Copyright (C) 2012 Wiktoria Golik, Zorana Ratkovic, Robert Bossy, Claire Nédellec and Thierry Hamon
73              
74             This library is free software; you can redistribute it and/or modify
75             it under the same terms as Perl itself, either Perl version 5.8.6 or,
76             at your option, any later version of Perl 5 you may have available.
77              
78              
79             =cut
80              
81 5     5   15202 use Lingua::YaTeA;
  5         1921629  
  5         171  
82              
83             our @ISA = qw(Lingua::YaTeA);
84              
85             our $VERSION='0.11';
86              
87             sub new {
88 4     4 1 25066 my ($class,$command_line_options_h,$system_config_h) = @_;
89              
90 4 50       47 if ($Lingua::YaTeA::VERSION < 0.6) {
91 0         0 warn "***************************************************************************\n";
92 0         0 warn "Something wrong: attempting to use a version Lingua::YaTeA greater than 0.6\n";
93 0         0 warn "while found version is " . $Lingua::YaTeA::VERSION . "\n";
94 0         0 warn "Please install the right version\n\n";
95 0         0 warn "Exiting...\n";
96 0         0 warn "***************************************************************************\n";
97 0         0 exit -1;
98             }
99 4         47 my $this = $class->SUPER::new($command_line_options_h,$system_config_h);
100 4         974973 bless ($this,$class);
101              
102 4         24 return $this;
103             }
104              
105             sub load_config {
106             # my ($class, $rcfile) = @_;
107              
108 4     4 1 56 my $rcfile;
109 4         10 my $class = shift;
110              
111 4 100       23 if (@_) {
112 3         10 $rcfile = shift;
113             } else {
114 1         3 $rcfile = $class;
115             }
116            
117            
118 4 50 33     38 if ((! defined $rcfile) || ($rcfile eq "")) {
119 0         0 $rcfile = "/etc/bioyatea/bioyatea.rc";
120             }
121              
122 4         1081 print STDERR "$rcfile : $class\n";
123              
124 4         45 return(Lingua::YaTeA::load_config($rcfile));
125             }
126              
127             1;