line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::sfx_year_range; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
101102
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
194515
|
|
|
1
|
|
|
|
|
8
|
|
4
|
1
|
|
|
1
|
|
301
|
use Catmandu::Util qw(:is); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
269
|
|
5
|
1
|
|
|
1
|
|
8
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
1018
|
use Catmandu::SFX; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
31
|
|
7
|
1
|
|
|
1
|
|
455
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
785
|
|
|
1
|
|
|
|
|
5
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::Fix::SimpleGetValue'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub emit_value { |
14
|
1
|
|
|
1
|
0
|
3358
|
my ($self, $var, $fixer) = @_; |
15
|
1
|
|
|
|
|
11
|
my $sfx = $fixer->capture(Catmandu::SFX->new()); |
16
|
1
|
|
|
|
|
75
|
"if (is_array_ref(${var})) {" . |
17
|
|
|
|
|
|
|
"${var} = ${sfx}->parse_sfx_year_range(${var}); " . |
18
|
|
|
|
|
|
|
"}"; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=encoding utf-8 |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Catmandu::Fix::sfx_year_range - parse the SFX threshold data |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Parse an array of years into a human reabable string |
30
|
|
|
|
|
|
|
# E.g. |
31
|
|
|
|
|
|
|
# holding: 1900 , 1901 , 1902 , 1920 , 1980 , 1981 , 1982 |
32
|
|
|
|
|
|
|
sfx_year_range(holding) |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Holding will be: 1900 - 1902 ; 1920 ; 1980 - 1982 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 AUTHOR |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Patrick Hochstenbach <Patrick.Hochstenbach@UGent.be> |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This software is copyright (c) 20145by Patrick Hochstenbach. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
45
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |