From: Tara L Andrews Date: Tue, 4 Oct 2011 00:00:22 +0000 (+0200) Subject: update parse interface; remove HTML output X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7fd4b80c9ede30cc317ee31c1c2cbb262a0d8382;p=scpubgit%2Fstemmatology.git update parse interface; remove HTML output --- diff --git a/group_vars.pl b/group_vars.pl index 02650c6..a6f7a5e 100644 --- a/group_vars.pl +++ b/group_vars.pl @@ -10,23 +10,11 @@ binmode STDERR, ":utf8"; binmode STDOUT, ":utf8"; eval { no warnings; binmode $DB::OUT, ":utf8"; }; -my $informat = 'TEI'; -my $inbase; -my $linear = 1; - # Parse the tradition data +my $informat = 'Self'; -my $input = $ARGV[0]; -my @lines; -open( INFILE, "$input" ) or die "Could not read $input"; -binmode INFILE, ':utf8'; -@lines = ; -close INFILE; -$input = join( '', @lines ); - -my %args = ( $informat => $input, - 'linear' => $linear ); -$args{'base'} = $inbase if $inbase; +my %args = ( 'input' => $informat, + 'file' => $ARGV[0] ); my $tradition = Text::Tradition->new( %args ); # Parse the stemma hypothesis @@ -114,30 +102,6 @@ binmode STEMMA, ":utf8"; print STEMMA $stemma->as_svg; close STEMMA; -# Save the used variants as an HTML table -open( TABLE, ">variant_table.html" ) or die "Could not save variant table"; -binmode TABLE, ":utf8"; -print TABLE "\n"; -foreach my $row ( @$html_data ) { - my( $rank, $readings, $sc ) = @$row; - # Do we have a stemma conflict or a distance-tree conflict? - my $class = scalar keys %$sc ? 'coincidental' : 'genealogical'; - print TABLE sprintf( "\t\n", "variant-$rank", $class ); - # Table row header should be the graph rank. - print TABLE "\t\t\n"; - my $ctr = 0; - foreach my $rdg ( @$readings ) { - print TABLE sprintf( "\t\t\n", "item-$rank-$ctr", $rdg ); - $ctr++; - } - # Pad out the table - is this necessary I wonder? - while( $ctr++ < $html_columns ) { - print TABLE "\t\t\n"; -} -print TABLE "
$rank%s\n"; - } - print TABLE "\t
\n"; - printf( "Ran analysis on %d / %d variant locations\n", scalar @$html_data, $total ); sub analyze_variant_location {