"; } $string .= $text{$lg}->{s}->[$t]; if(scalar @targets1 > 1){ $string .= "
"; } } $string .= "<\/s$n>\n"; } else{ $string .= "((.|\n|\r)*)<\/p>/i) {
# print $1,"\t", $2,"\n";
$txtInfo->{s}->[$1]=$2;
}
}
close $F;
return $txtInfo;
}
__END__
=head1 NAME
getAlignmentWithText.pl - program that add the text to the alignment files.
=head1 SYNOPSIS
perl getAlignmentWithText.pl -acquisDir "JRC-Acquis_corpus_folder" jrc-en-fr.xml >en-fr_alignedCorpus_withText.xml
To select only the document from a list of celex codes :
perl getAlignmentWithText.pl -acquisDir "JRC-Acquis_corpus_folder" -selectionList "file_withCelexCode" jrc-en-fr.xml >en-fr_alignedCorpus_withText.xml
To process more files use an output folder as following:
perl getAlignmentWithText.pl -acquisDir "JRC-Acquis_corpus_folder" -selectionList "file_withCelexCode" -outDir "Output_folder" jrc-bg-cs.xml jrc-en-it.xml
=head1 DESCRIPTION
To get the aligned corpora for a language pair, the program need as input the corpora by language and the alignment information. The corpora will be provided by the option "acquisDir" that will specify where the Acquis corpus is located. If the option is not specified the default value is the current directory.
The alignment information will be provided as argument.
Using the option "selectionList" you can provided a list of Celex codes that has to be processed and the programm will output only the files that has the Celex code specified in the list. The codes are given in a file - one celex code by line. This option could be useful if you want to process only documents that have Eurovoc descriptors.
The option "outDir" gives the possibility to process more than one language pair. You have to specify all the language pairs that you want to process as arguments and to give the output directory where the alignments with text will be written.
The result files will have the name composed by the name of the input file (without extension) followed by "_withText", followed by the extension (i.e. jrc-en-fr_withText.xml)
The program outputs an aligned corpus, containing documents in the following format:
...
19 paragraph links: