From: tla Date: Wed, 15 Jan 2014 18:47:04 +0000 (+0100) Subject: use new stemma util interface; configure correct IDP server. Fixes #31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a919a152d9b5302279c6cfad6d51866082e6325c;p=scpubgit%2Fstemmaweb.git use new stemma util interface; configure correct IDP server. Fixes #31 --- diff --git a/Makefile.PL b/Makefile.PL index a87978f..6dd80af 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,7 +12,7 @@ all_from 'lib/stemmaweb.pm'; # 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'; diff --git a/lib/stemmaweb/Controller/Root.pm b/lib/stemmaweb/Controller/Root.pm index 8fa2489..bc86c30 100644 --- a/lib/stemmaweb/Controller/Root.pm +++ b/lib/stemmaweb/Controller/Root.pm @@ -396,21 +396,6 @@ sub stemma :Local :Args(2) { 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/(? ( + is => 'ro', + isa => 'Str', + predicate => 'has_idp_solver_url', + ); + +has idp_calcdsn => ( + is => 'ro', + isa => 'Str', + predicate => 'has_idp_calcdsn', + ); =head1 NAME @@ -72,8 +83,12 @@ sub index :Path :Args(2) { } 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'}} ) { diff --git a/stemmaweb.conf b/stemmaweb.conf index 14dc998..b856c61 100644 --- a/stemmaweb.conf +++ b/stemmaweb.conf @@ -1,6 +1,9 @@ # 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 + + idp_solver_url http://perf.byzantini.st/cgi-bin/graphcalc.cgi + dsn dbi:SQLite:dbname=db/traditions.db