# Tradition libraries
requires 'Text::Tradition' => '1.2';
requires 'Text::Tradition::Directory';
-requires 'Text::Tradition::Analysis';
+requires 'Text::Tradition::Analysis' => '1.3';
requires 'Text::Tradition::StemmaUtil';
# Catalyst libraries
requires 'Catalyst::Runtime' => '5.90002';
if( $c->req->method eq 'POST' ) {
if( $ok eq 'full' ) {
my $dot = $c->request->body_params->{'dot'};
- # Graph::Reader::Dot does not handle bare unicode. We get around this
- # by wrapping all words in double quotes, as long as they aren't already
- # wrapped, and as long as they aren't the initial '(di)?graph .*'.
- # Horrible HACK.
- my @dlines = split( "\n", $dot );
- my $wdot = '';
- foreach( @dlines ) {
- unless( /^(di)?graph/ ) { # Skip the first line
- s/(?<!")\b(\w+)\b(?!")/"$1"/g;
- }
- $wdot .= "$_\n";
- }
- # $dot =~ s/(?<!")\b(?!(?:digraph|stemma)\b)(\w+)\b(?!")/"$1"/g;
- $dot = $wdot;
- print STDERR "$dot\n";
try {
if( $stemmaid eq 'n' ) {
# We are adding a new stemma.
BEGIN { extends 'Catalyst::Controller' }
+has idp_solver_url => (
+ is => 'ro',
+ isa => 'Str',
+ predicate => 'has_idp_solver_url',
+ );
+
+has idp_calcdsn => (
+ is => 'ro',
+ isa => 'Str',
+ predicate => 'has_idp_calcdsn',
+ );
=head1 NAME
} elsif( $ignore_sort eq 'orthographic' ) {
$analysis_options{'merge_types'} = 'orthographic';
}
+ if( $self->has_idp_solver_url ) {
+ $analysis_options{'solver_url'} = $self->idp_solver_url;
+ } elsif( $self->has_idp_calcdsn ) {
+ $analysis_options{'calcdsn'} = $self->idp_calcdsn;
+ }
- # Do the deed
my $t = run_analysis( $tradition, %analysis_options );
# Stringify the reading groups
foreach my $loc ( @{$t->{'variants'}} ) {
# rename this file to stemmaweb.yml and put a ':' after 'name' if
# you want to use YAML like in old versions of Catalyst
name = stemmaweb
+<Component Controller::Stexaminer>
+ idp_solver_url http://perf.byzantini.st/cgi-bin/graphcalc.cgi
+</Controller>
<Model Directory>
dsn dbi:SQLite:dbname=db/traditions.db
</Model>