X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmetadata%2Fcreate_V7_mowgli%2Finvert.pl;h=9024799209851620fcff0d03064221b3d96abe42;hb=9f60b3b0f4460aec52ec241037f6c475b421dd15;hp=df345064965eef4048f339c0df172b63a23878b0;hpb=0e6b8620b9c128c3f256c00b422cee7708321171;p=helm.git diff --git a/helm/metadata/create_V7_mowgli/invert.pl b/helm/metadata/create_V7_mowgli/invert.pl index df3450649..902479920 100755 --- a/helm/metadata/create_V7_mowgli/invert.pl +++ b/helm/metadata/create_V7_mowgli/invert.pl @@ -4,21 +4,23 @@ my $inputfile = $ARGV[0]; print "Now splitting file $inputfile\n"; open(IN, "<$inputfile") or die "Error opening file $inputfile"; -$dummy = ; # -$dummy = ; # -$dummy = ; # -$where = ; # +my $where; +while(($where = ) && not ($where =~ /$/$1/; -while(($line1 = ) && not ($line1 =~ /<\/h:Object>/)) { - $line2 = ; # - $line3 = ; # value - $line4 = ; # value - $line5 = ; # - $line6 = ; # +while(($line1 = ) && not ($line1 =~ /<\/h:Object>/)) { # ; # + $position = $line2; + chomp($position); + $position =~ s/^[ \t]*[^"]*"&hns;([^"]*)"\/>/$1/; + if ($position eq 'MainHypothesis' || $position eq 'MainConclusion') { + $line3 = ; # value + } + $line4 = ; # + $line5 = ; # $uri = $line4; chomp($uri); - $uri =~ s/^[ \t]*([^<]*)<\/h:occurrence>$/$1/; + $uri =~ s/^[ \t]*<\/h:occurrence>$/$1/; $who = $uri; $who =~ s/^cic:/backward/; $who =~ s/#xpointer\(1\/([^\/]*)\/([^\/]*)\)/,$1,$2/; @@ -26,11 +28,12 @@ while(($line1 = ) && not ($line1 =~ /<\/h:Object>/)) { $line4 =~ s/\Q$uri\E/$where/; open(OUT, ">>$who") or die "Error opening file $who"; - print OUT "\t\t\n"; + print OUT "\t\t\n"; print OUT $line2; - print OUT $line3; + if ($position eq 'MainHypothesis' || $position eq 'MainConclusion') { + print OUT $line3; + } print OUT $line4; - print OUT $line5; print OUT "\t\t\n"; close(OUT); }