From: Tara L Andrews Date: Sun, 2 Oct 2011 00:06:50 +0000 (+0200) Subject: work in progress X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3a5d151b91cc8cf4e0e7a8643285e4da30b91531;p=scpubgit%2Fstemmatology.git work in progress --- diff --git a/lib/Text/Tradition/Parser/CTE.pm b/lib/Text/Tradition/Parser/CTE.pm index faabf7b..954a84a 100644 --- a/lib/Text/Tradition/Parser/CTE.pm +++ b/lib/Text/Tradition/Parser/CTE.pm @@ -193,7 +193,8 @@ sub _add_readings { # For each reading, send its text to 'interpret' along with the lemma, # and then save the list of witnesses that these tokens belong to. - my %wit_rdgs; + my %wit_rdgs; # Maps from witnesses to the variant text + my %wit_details; # Maps from witnesses to the witness detail e.g. a.c. my $ctr = 0; my $tag = $app_id; $tag =~ s/^\#APP_(.*)\#$/$1/; @@ -213,7 +214,16 @@ sub _add_readings { push( @rdg_nodes, $r ); } $wit_rdgs{$wits} = \@rdg_nodes; + # Does the reading have an ID? If so it probably has a witDetail + # attached, and that may be something we need to know. For now, + # save the reading ID. + if( $rdg->hasAttribute( 'xml:id' ) ) { + $wit_details{$wits} = $rdg->getAttribute( 'xml:id' ); + } } + # Now go through the available witDetails and, er, do something + # foreach my $d ( $xn->getChildrenByTagName( 'witDetail' ) ) { + # my $referent = # Now collate the variant readings, since it is not done for us. collate_variants( $c, \@lemma, values %wit_rdgs );