From: Tara L Andrews Date: Mon, 1 Oct 2012 04:07:54 +0000 (+0200) Subject: slightly looser a.c. / p.c. parsing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ed2b212af50aba568ec4fb0cbefa0efec2bb906;p=scpubgit%2Fstemmatology.git slightly looser a.c. / p.c. parsing --- diff --git a/base/lib/Text/Tradition/Parser/CTE.pm b/base/lib/Text/Tradition/Parser/CTE.pm index f161068..b8b2abc 100644 --- a/base/lib/Text/Tradition/Parser/CTE.pm +++ b/base/lib/Text/Tradition/Parser/CTE.pm @@ -367,14 +367,15 @@ sub interpret { sub _parse_wit_detail { my( $detail, $readings, $lemma ) = @_; + $DB::single = 1 if my $wit = $detail->getAttribute( 'wit' ); my $content = $detail->textContent; - if( $content =~ /a\.\s*c\./ ) { + if( $content =~ /a\.\s*c\b/ ) { # Replace the key in the $readings hash my $rdg = delete $readings->{$wit}; $readings->{$wit.'_ac'} = $rdg; $has_ac{$sigil_for{$wit}} = 1; - } elsif( $content =~ /p\.\s*c\./ ) { + } elsif( $content =~ /p\.\s*c\b/ ) { # If no key for the wit a.c. exists, add one pointing to the lemma unless( exists $readings->{$wit.'_ac'} ) { $readings->{$wit.'_ac'} = $lemma;