=item * merge_types - Specify a list of relationship types, where related readings
should be treated as identical for the purposes of analysis.
-=item * exclude_type1 - Exclude those ranks whose groupings have only type-1 variants.
-
=back
=begin testing
my %lacunae;
foreach my $rank ( @ranks ) {
my $missing = [ @lacunose ];
- my $rankgroup = group_variants( $tradition, $rank, $missing, \@collapse );
- if( $opts{'exclude_type1'} ) {
- # Check to see whether this is a "useful" group.
- my( $rdgs, $grps ) = _useful_variant( $rankgroup );
- next unless @$rdgs;
- }
- push( @groups, $rankgroup );
+ push( @groups, group_variants( $tradition, $rank, $missing, \@collapse ) );
$lacunae{$rank} = $missing;
}
$DB::single = 1;
be a reference to an array, to which the sigla of lacunose witnesses at this
rank will be appended.
-Returns a hash $group_readings where $rdg is attested by the witnesses listed
-in $group_readings->{$rdg}.
+Returns two ordered lists $readings, $groups, where $readings->[$n] is attested
+by the witnesses listed in $groups->[$n].
=cut
foreach my $text ( $dir->traditionlist ) {
my $id = $text->{'id'};
+ next unless $text->{'name'} =~ /Virtutes/;
my $scope = $dir->new_scope;
my $tradition = $dir->lookup( $id );
print STDERR "Processing tradition " . $tradition->name . "\n";
my $c = $tradition->collation;
+ $c->flatten_ranks(); # just in case
foreach my $rank ( 1 .. $c->end->rank - 1 ) {
my @readings = $c->readings_at_rank( $rank );
+ my %merged;
while( @readings ) {
my $r = pop @readings;
next if $r->is_meta;
+ next if $merged{$r->id};
my @orthmatch = grep { lc( $r->text ) eq lc( $_->text ) } @readings;
foreach my $om ( @orthmatch ) {
- unless( $c->get_relationship( $r, $om ) ) {
- print STDERR sprintf( "Adding orthographic link for %s / %s\n",
- $r->text, $om->text );
- $DB::single = 1;
+ if( $r->text eq $om->text ) {
+ print STDERR "Merging identical readings $r and $om ("
+ . $r->text . ")\n";
+ $merged{$om->id} = 1;
+ $c->merge_readings( $r, $om );
+ } elsif ( $c->get_relationship( $r, $om ) ) {
+ print STDERR sprintf( "Adding orthographic link for %s and %s (%s / %s)\n",
+ $r->id, $om->id, $r->text, $om->text );
$c->add_relationship( $r, $om,
{ 'type' => 'orthographic', 'scope' => 'global' } );
}
$c->stash->{text_title} = $tradition->name;
$c->stash->{template} = 'stexaminer.tt';
# TODO Run the analysis as AJAX from the loaded page.
- my $t = run_analysis( $tradition, 'exclude_type1' => 1 );
+ my $t = run_analysis( $tradition );
# Stringify the reading groups
foreach my $loc ( @{$t->{'variants'}} ) {
my $mst = wit_stringify( $loc->{'missing'} );
width: 89%;
z-index: 2;
opacity: 0.7;
- background-color: #c5c5c5;
+ background-image: url("cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png");
+ background-repeat: repeat;
+ background-attachment: scroll;
+ background-position: 50% 50%;
+ background-color: #EEEEEE;
+}
+#loading_message {
+ position: relative;
+ background-color: #EDF1FA;
+ color: #222222;
+ border: 2px solid #B0C6F7;
+ height: 20px;
+ width: 150px;
+ padding: 20px;
}
#dialog_overlay {
display: none;
function svgEnlargementLoaded() {
//Give some visual evidence that we are working
$('#loading_overlay').show();
+ lo_height = $("#enlargement_container").outerHeight();
+ lo_width = $("#enlargement_container").outerWidth();
+ $("#loading_overlay").height( lo_height );
+ $("#loading_overlay").width( lo_width );
+ $("#loading_overlay").offset( $("#enlargement_container").offset() );
+ $("#loading_message").offset(
+ { 'top': lo_height / 2 - $("#loading_message").height() / 2,
+ 'left': lo_width / 2 - $("#loading_message").width() / 2 });
//Set viewbox widht and height to widht and height of $('#svgenlargement svg').
//This is essential to make sure zooming and panning works properly.
$('#svgenlargement ellipse').attr( {stroke:'green', fill:'#b3f36d'} );
svg_g.setAttribute('transform', transform);
//used to calculate min and max zoom level:
start_element_height = $("#svgenlargement .node title:contains('#START#')").siblings('ellipse')[0].getBBox().height;
- add_relations();
- // $('#loading_overlay').hide();
+ add_relations( function() { $('#loading_overlay').hide(); });
}
-function add_relations() {
+function add_relations( callback_fn ) {
var basepath = getRelativePath();
var textrelpath = getRelationshipURL();
$.getJSON( basepath + '/definitions', function(data) {
node_obj.set_draggable( false );
node_obj.ellipse.data( 'node_obj', null );
}
- })
+ });
+ callback_fn.call();
});
});
}
$(".ui-widget-overlay").css("background", "none");
$("#dialog_overlay").show();
$("#dialog_overlay").height( $("#enlargement_container").height() );
- $("#dialog_overlay").width( $("#enlargement_container").width() );
+ $("#dialog_overlay").width( $("#enlargement_container").innerWidth() );
$("#dialog_overlay").offset( $("#enlargement_container").offset() );
},
close: function() {
</div>
<div id="enlargement_container">
- <div id="loading_overlay"></div>
+ <div id="loading_overlay">
+ <div id="loading_message"><span>Loading, please wait...</span></div>
+ </div>
+ <div id="dialog_overlay"></div>
<div id="enlargement">
<div id="svgenlargement" style="height: 500px;"></div>
</div>
#!/usr/bin/env perl
+eval { no warnings; $DB::deep = 1000; binmode $DB::OUT, ':utf8' };
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('stemmaweb', 'Test');