From: Tara L Andrews Date: Tue, 28 Aug 2012 10:54:48 +0000 (+0200) Subject: get rid of intermediate local analysis DB X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ccbe93158a373b6b7202436400ba0c788a725d14;p=scpubgit%2Fstemmaweb.git get rid of intermediate local analysis DB --- diff --git a/lib/stemmaweb/Controller/Stexaminer.pm b/lib/stemmaweb/Controller/Stexaminer.pm index 309f8d6..16c515f 100644 --- a/lib/stemmaweb/Controller/Stexaminer.pm +++ b/lib/stemmaweb/Controller/Stexaminer.pm @@ -32,7 +32,6 @@ Renders the application for the text identified by $textid. sub index :Path :Args(1) { my( $self, $c, $textid ) = @_; my $m = $c->model('Directory'); - my $am = $c->model('Analysis'); my $tradition = $m->tradition( $textid ); if( $tradition->stemma_count ) { my $stemma = $tradition->stemma(0); @@ -43,21 +42,19 @@ sub index :Path :Args(1) { # Get the analysis options my( $use_type1, $ignore_sort ) = ( 0, 'none' ); - if( $c->req->method eq 'POST' ) { - $use_type1 = $c->req->param( 'show_type1' ) ? 1 : 0; - $ignore_sort = $c->req->param( 'ignore_variant' ); - } + $use_type1 = $c->req->param( 'show_type1' ) ? 1 : 0; + $ignore_sort = $c->req->param( 'ignore_variant' ) || ''; $c->stash->{'show_type1'} = $use_type1; $c->stash->{'ignore_variant'} = $ignore_sort; # TODO Run the analysis as AJAX from the loaded page. - my %analysis_options = ( calcdir => $am ); - $analysis_options{'exclude_type1'} = !$use_type1; + my %analysis_options = ( exclude_type1 => !$use_type1 ); if( $ignore_sort eq 'spelling' ) { $analysis_options{'merge_types'} = [ qw/ spelling orthographic / ]; } elsif( $ignore_sort eq 'orthographic' ) { $analysis_options{'merge_types'} = 'orthographic'; } - + + # Do the deed my $t = run_analysis( $tradition, %analysis_options ); # Stringify the reading groups foreach my $loc ( @{$t->{'variants'}} ) { diff --git a/lib/stemmaweb/Model/Analysis.pm b/lib/stemmaweb/Model/Analysis.pm deleted file mode 100644 index 75e6732..0000000 --- a/lib/stemmaweb/Model/Analysis.pm +++ /dev/null @@ -1,11 +0,0 @@ -package stemmaweb::Model::Analysis; -use strict; -use warnings; -use Moose; -use Text::Tradition::Directory; - -extends 'Catalyst::Model::KiokuDB'; - -has '+model_class' => ( default => 'Text::Tradition::Directory' ); - -1; diff --git a/stemmaweb.conf b/stemmaweb.conf index 7983257..a0169dc 100644 --- a/stemmaweb.conf +++ b/stemmaweb.conf @@ -1,9 +1,6 @@ # 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 - - dsn dbi:SQLite:dbname=db/analysis.db - dsn dbi:SQLite:dbname=db/traditions.db