X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmetadata%2Fcreate_V7_mowgli%2Finvert.pl;h=a20e52d9d9977c3e0b5c92a708028700bade07c4;hb=bd0acf4e61bad9444b75d8f9822cf68eef06b69e;hp=df345064965eef4048f339c0df172b63a23878b0;hpb=ae7dbddb8d6f07470db18955cc614972603cc2a9;p=helm.git diff --git a/helm/metadata/create_V7_mowgli/invert.pl b/helm/metadata/create_V7_mowgli/invert.pl index df3450649..a20e52d9d 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/; @@ -28,9 +30,10 @@ while(($line1 = ) && not ($line1 =~ /<\/h:Object>/)) { open(OUT, ">>$who") or die "Error opening file $who"; 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); }