my @keys = @_;
my @cur;
my @new;
+ my @newend; # only used for combined issues
my $incr;
- my @candidate;
my $reg = $self->{_mfhdc_REGULARITY};
my $pattern = $self->{_mfhdc_PATTERN};
}
foreach my $pat (@pats) {
- @candidate = $genfunc->($pat, @cur);
+ my @candidate = $genfunc->($pat, @cur);
+
while ($self->is_omitted(@candidate)) {
# printf("# pubpat omitting date '%s'\n",
# join('/', @candidate));
}
}
}
+
+ # Now check for combined issues, like "May/June"
+ foreach my $combpat (@{$pattern->{y}->{c}}) {
+ my $chroncode = substr($combpat, 0, 1);
+ my $genfunc = MFHD::Date::generator($chroncode);
+ my @pats = split(/,/, substr($combpat, 1));
+
+ foreach my $combined (@pats) {
+ my ($start, $end) = split('/', $combined, 2);
+ my @candidate = $genfunc->($start, @cur);
+
+ # We don't need to check for omitted issues because
+ # combined issues are always published. OR ARE THEY????
+ if (!defined($new[0])
+ || !on_or_after($candidate[0], $candidate[1], $new[0], $new[1])) {
+ # Haven't found a next issue at all yet, or
+ # this one is before the best guess so far
+ @new = @candidate;
+ @newend = $genfunc->($end, @cur);
+ }
+ }
+ }
+
+ if (defined($newend[0])) {
+ # The best match was a combined issue
+ foreach my $i (0..$#new) {
+ # don't combine identical fields
+ next if $new[$i] eq $newend[$i];
+ $new[$i] .= '/' . $newend[$i];
+ }
+ }
} else {
# There is no $y publication pattern defined, so use
# the $w frequency to figure out the next date
245 00 $aBimonthly, published 5 times with combined summer issue: Feb, Apr, June/Aug, Oct, Dec
853 20 $820$av.$bno.$u5$vr$i(year)$j(month)$wb$x02$ypm02,04,10,12$ycm06/08
-863 41 $820.1$a1$b2$i1990$j04$x|a1|b3|i1990|j06/08$zTODO From Apr to Jun/Aug
+863 41 $820.1$a1$b2$i1990$j04$x|a1|b3|i1990|j06/08$zFrom Apr to Jun/Aug
863 41 $820.2$a1$b3$i1990$j06/08$x|a1|b4|i1990|j10$zFrom Jun/Aug to Oct
863 41 $820.3$a1$b5$i1990$j12$x|a2|b1|i1991|j02$zWrap at end of year/vol.