add first-cut module for stemma analysis
[scpubgit/stemmatology.git] / script / svg_from_graphml.pl
CommitLineData
5f5e51a5 1#!/usr/bin/perl
2
3use lib 'lib';
4use strict;
5use warnings;
6use Text::Tradition;
7
8# First: read the base. Make a graph, but also note which
9# nodes represent line beginnings.
10
11open( GRAPH, $ARGV[0] ) or die "Could not read file $ARGV[0]";
12my @lines = <GRAPH>;
13close GRAPH;
14my $graphml_str = join( '', @lines );
15
16my $tradition = Text::Tradition->new(
9463b0bf 17 'CollateX' => $graphml_str,
18 'linear' => 1,
5f5e51a5 19 );
20
21print $tradition->collation->as_svg();
22print STDERR "DONE\n";