---
-abstract: ~
+abstract: 'a software model for a set of collated texts'
author:
- 'Tara L Andrews <aurum@cpan.org>'
build_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.56
configure_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.56
distribution_type: module
-generated_by: 'Module::Install version 0.91'
+dynamic_config: 1
+generated_by: 'Module::Install version 1.00'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
Text::CSV_XS: 0
XML::LibXML: 0
XML::LibXML::XPathContext: 0
- perl: 5.010
+ perl: 5.12.0
resources:
license: http://dev.perl.org/licenses/
-version: undef
+version: 0.1
map { $text->{$_->sigil} = [] } $tradition->witnesses;
# Look for all word/seg node IDs and note their pre-existence.
- my @attrs = $xpc->findnodes( "//$W|$SEG/attribute::xml:id" );
+ my @attrs = $xpc->findnodes( "//$W/attribute::xml:id" );
_save_preexisting_nodeids( @attrs );
# Count up how many apps we have.
# Join them up.
my $c = $tradition->collation;
foreach my $sig ( keys %$text ) {
- next if $sig eq 'base'; # Skip base text readings with no witnesses.
# Determine the list of readings for
my $sequence = $text->{$sig};
my @real_sequence = ( $c->start );
}
# Calculate the ranks for the nodes.
- $tradition->collation->calculate_ranks();
+ $tradition->collation->calculate_ranks();
# Now that we have ranks, see if we have distinct nodes with identical
# text and identical rank that can be merged.
# TODO handle p.c. and s.l. designations too
$ac = $xn->getAttribute( 'type' ) && $xn->getAttribute( 'type' ) eq 'a.c.';
my @rdg_wits = _get_sigla( $xn );
- @rdg_wits = ( 'base' ) unless @rdg_wits; # Allow for editorially-supplied readings
+ return unless @rdg_wits; # Skip readings that appear in no witnesses
my @words;
foreach ( $xn->childNodes ) {
my @rdg_set = _get_readings( $tradition, $_, 1, $ac, @rdg_wits );
push( @{$text->{$w}}, $l );
}
}
- } elsif( $xn->nodeName eq 'witDetail' ) {
+ } elsif( $xn->nodeName eq 'witDetail'
+ || $xn->nodeName eq 'note' ) {
# Ignore these for now.
return;
} else {
my @wits;
if( ref( $rdg ) eq 'XML::LibXML::Element' ) {
my $witstr = $rdg->getAttribute( 'wit' );
+ return () unless $witstr;
$witstr =~ s/^\s+//;
$witstr =~ s/\s+$//;
@wits = split( /\s+/, $witstr );
my %unique = ( '__UNDEF__' => 'X',
'#LACUNA#' => '?',
);
+ my %count;
my $ctr = 0;
foreach my $word ( @$row ) {
if( $word && !exists $unique{$word} ) {
$unique{$word} = chr( 65 + $ctr );
$ctr++;
}
+ $count{$word}++ if $word;
}
+ # Try to keep variants under 8 by lacunizing any singletons.
if( scalar( keys %unique ) > 8 ) {
+ foreach my $word ( keys %count ) {
+ if( $count{$word} == 1 ) {
+ $unique{$word} = '?';
+ }
+ }
+ }
+ my %u = reverse %unique;
+ if( scalar( keys %u ) > 8 ) {
warn "Have more than 8 variants on this location; phylip will break";
}
my @chars = map { $_ ? $unique{$_} : $unique{'__UNDEF__' } } @$row;
binmode STDOUT, ":utf8";
eval { no warnings; binmode $DB::OUT, ":utf8"; };
-my( $informat, $inbase, $outformat, $help, $linear, $name, $HACK )
- = ( '', '', '', '', 1, 'Tradition', 0 );
+my( $informat, $inbase, $outformat, $help, $linear, $name, $HACK, $sep )
+ = ( '', '', '', '', 1, 'Tradition', 0, ',' );
GetOptions( 'i|in=s' => \$informat,
'b|base=s' => \$inbase,
'l|linear!' => \$linear,
'n|name' => \$name,
'h|help' => \$help,
+ 'sep=s' => \$sep,
'hack' => \$HACK,
);
'linear' => $linear );
$args{'base'} = $inbase if $inbase;
$args{'name'} = $name if $name;
+$args{'sep_char'} = $sep if $informat eq 'Tabular';
### Custom hacking for Stone
if( $informat eq 'CollateText' ) {
$args{'sigla'} = [ qw/ S M X V Z Bb B K W L / ];