diff --git a/outils/stats-corpus/README.md b/outils/stats-corpus/README.md index 66f35f9..c6368dd 100644 --- a/outils/stats-corpus/README.md +++ b/outils/stats-corpus/README.md @@ -4,8 +4,8 @@ Outil de statistiques descriptives sur les corpus ISTEX extraits par **harvestCorpus.pl** Permet de faire des statistiques sur les fichiers extraits d’ISTEX en utilisant le fichier -de métadonnées “logRequete.txt” (cf. l’option “-v” du programme “harvestCorpus.pl”) ou les -fichiers de métadonnées JSON correspondants aux documents extraits.. +de métadonnées `logRequete.txt` (cf. l’option `-v` du programme [`harvestCorpus.pl`](../../../..)) ou les +fichiers de métadonnées JSON correspondants aux documents extraits. Si les fichiers XML éditeurs ont été extraits, il permet aussi de vérifier s’ils ont ou non les documents sous forme de texte structuré. @@ -26,7 +26,7 @@ créé par l’option “-v” du programme “harvestCorpus.pl”. Par défaut, ce fichier s’appelle “logRequete.txt” et se trouve dans le répertoire des fichiers déchargés depuis le serveur ISTEX. - -c indique le nom du fichier “corpus” généré par le programme “harvestCorpus.pl” permettant + -c indique le nom du fichier “.corpus” généré par le programme “harvestCorpus.pl” permettant de faire le lien entre l’identifiant ISTEX d’un document et le nom des fichiers extraits correspondants. -h affiche l’aide. @@ -42,7 +42,7 @@ ``` statsCorpus.pl -l Arthropodes/logRequete.txt -c Arthropodes_v2b.corpus -r Arthropodes statsCorpus.pl -m Vieillissement -r Vieillissement -s Vieil.tsv - statsCorpus.pl -m Vieillissement -s Vieil.tsv (identique au précédent) + statsCorpus.pl -m Vieillissement -s Vieil.tsv (identique au précédent) ``` ### Données extraites diff --git a/outils/stats-corpus/statsCorpus.pl b/outils/stats-corpus/statsCorpus.pl index f769060..77c3ece 100755 --- a/outils/stats-corpus/statsCorpus.pl +++ b/outils/stats-corpus/statsCorpus.pl @@ -18,8 +18,8 @@ my ($programme) = $0 =~ m|^(?:.*/)?(.+)|; -my $version = "1.4.1"; -my $dateModif = "1 Mars 2018"; +my $version = "1.5.3"; +my $dateModif = "7 Mars 2018"; # Variables my $aide = 0; @@ -95,6 +95,9 @@ chomp; s/\r//go; # Au cas où ... my ($type, $id, $com, $nom) = split(/\s+/); + if ( $type eq 'ark' and $id !~ /^ark:/o ) { + $id = "ark:$id"; + } $racine{$id} = $nom; } } @@ -109,7 +112,7 @@ "cambridge" => "Cambridge", "sage" => "Sage", "bmj" => "BMJ", - "springer-ebooks" => "Sprnger (e-books)", + "springer-ebooks" => "Springer (e-books)", "iop" => "IOP", "nature" => "Nature", "rsc-journals" => "RSC (journals)", @@ -236,7 +239,8 @@ $fichier = "Nom de fichier inconnu"; } my $titre = $hit{'title'}; -my $nom = $hit{'corpusName'}; +my $corpusName = $hit{'corpusName'}; +my $nom = $corpusName; if ( $nom{$nom} ) { $nom = $nom{$nom}; } @@ -310,59 +314,105 @@ $texte .= $_; } close XML; - # Wiley - if ( $texte =~ m|xmlns="http://www.wiley.com/namespaces/wiley"|o ) { - $structure = "Oui" if $texte =~ /\s*.+.*}o; } - # Elsevier - elsif ( $texte =~ m#xmlns:(ce|sb)="http://www.elsevier.com/xml/common/.*dtd"#oi ) { - $structure = "Oui" if $texte =~ m|\s*\s*|oi; + elsif ( $corpusName eq 'ecco' ) { + $structure = "Oui" if $texte =~ /

\s*Brill|o ) { - $structure = "Oui" if $texte =~ m|\s*\s*\s*/oi; } - # OUP - elsif ( $texte =~ m|Oxford University Press|o ) { - $structure = "Oui" if $texte =~ m|\s*\s*Emerald Group Publishing Limited|o or - $texte =~ m|MCB UP Ltd|o ) { - $structure = "Oui" if $texte =~ m|\s*|o; + $structure = "Non" if $texte =~ m||o; } - # IOP - elsif ( $texte =~ m|http://ej.iop.org/dtd|o ) { - $structure = "Oui" if $texte =~ m|\s*(BMJ|British Medical Journal) Publishing Group/o ) { - $structure = "Oui" if $texte =~ m|\s*\s*

|o; - } - # RSC - elsif ( $texte =~ m|http://www.rsc.org/|o ) { + elsif ( $corpusName =~ /^rsc-/o ) { $structure = "Oui" if $texte =~ m|\s*

Sage Publications|o ) { - $structure = "Oui" if $texte =~ /\*<(sec|p)\b/; + elsif ( $corpusName eq 'sage' ) { + if ( $texte =~ /\s*.+.*}o ) { + $structure = "Oui"; + } } - # Degruyter ou - # Cambridge University Publishing (CUP) - elsif ( $texte =~ m|-//NLM//DTD JATS \(Z39.96\) Journal Publishing DTD|o or # Cambridge - $texte =~ m|-//Atypon//DTD Atypon Systems .+ NLM DTD|o or # Degruyter - $texte =~ m|-//NLM//DTD Journal Publishing DTD|o ) { # Degruyter ou Cambridge ou Sage - $structure = "Oui" if $texte =~ /\*<(sec|p)\b/; - } - # Springer - elsif ( $texte =~ m|-//Springer-Verlag//DTD|o ) { + elsif ( $corpusName =~ /^springer-/o ) { $structure = "Non" if $texte =~ m|\s*\s*\s*\s*/oi; +# } +# # Brill +# elsif ( $texte =~ m|http://dtd.nlm.nih.gov/publishing|o or +# $texte =~ m|Brill|o ) { +# $structure = "Oui" if $texte =~ /\s*<(sec|p)\b/o; +# } +# # OUP +# elsif ( $texte =~ m|Oxford University Press|o ) { +# $structure = "Oui" if $texte =~ /\s*Emerald Group Publishing Limited|o or +# $texte =~ m|MCB UP Ltd|o ) { +# $structure = "Oui" if $texte =~ /\s*\s*(BMJ|British Medical Journal) Publishing Group/o or +# $texte =~ m|//NLM//DTD Journal Archiving and Interchange DTD|o ) { +# $structure = "Oui" if $texte =~ /\s*<(sec|p)\b/o; +# } +# # Nature +# elsif ( $texte =~ m|"-//NPG//DTD XML Article//EN"|o ) { +# $structure = "Oui" if $texte =~ m|\s*

|o; +# } +# # RSC +# elsif ( $texte =~ m|http://www.rsc.org/|o ) { +# $structure = "Oui" if $texte =~ m|\s*

Sage Publications|o ) { +# $structure = "Oui" if $texte =~ /\s*<(sec|p)\b/; +# } +# # Degruyter ou +# # Cambridge University Publishing (CUP) +# elsif ( $texte =~ m|-//NLM//DTD JATS \(Z39.96\) Journal Publishing DTD|o or # Cambridge +# $texte =~ m|-//Atypon//DTD Atypon Systems .+ NLM DTD|o or # Degruyter +# $texte =~ m|-//NLM//DTD Journal Publishing DTD|o ) { # Degruyter ou Cambridge ou Sage +# $structure = "Oui" if $texte =~ /\s*<(sec|p)\b/; +# } +# # Springer +# elsif ( $texte =~ m|-//Springer-Verlag//DTD|o ) { +# $structure = "Non" if $texte =~ m|\s*