8 use Text::Tradition::Analysis qw/ group_variants /;
9 use Text::Tradition::Stemma;
11 binmode STDERR, ":utf8";
12 binmode STDOUT, ":utf8";
13 eval { no warnings; binmode $DB::OUT, ":utf8"; };
15 # Parse the tradition data
16 my $informat = 'Self';
18 my %args = ( 'input' => $informat,
20 my $tradition = Text::Tradition->new( %args );
22 # Parse the stemma data
23 my $stemma = Text::Tradition::Stemma->new(
24 'collation' => $tradition->collation,
29 map { $wits->{$_} = 1 } $stemma->witnesses;
31 my $variant_groups = group_variants( $tradition->collation, $wits );
33 print encode_json( $variant_groups );