parent
5a91961dd8
commit
f2fba9dbb8
|
@ -33,19 +33,14 @@ sub add_line {
|
||||||
}
|
}
|
||||||
|
|
||||||
handle remainder => sub {
|
handle remainder => sub {
|
||||||
return unless s/^(?:the)?\s*(?:decimal)?\s*(?:system)?\s*(?:numbers?|\#)?\s*
|
return unless /^(?:the)?\s*(?:decimal)?\s*(?:system)?\s*(?:numbers?|\#)?\s*
|
||||||
(?:
|
(?:
|
||||||
(?<num>\d{1,3})(?:\.\d+)?(?<multi>s)? |
|
(?<num>\d{1,3})(?:\.\d+)?(?<multi>s)? |
|
||||||
(?<word>[\w\s]+?)
|
(?<word>[\w\s]+?)
|
||||||
)
|
)
|
||||||
\s*(?:in)?\s*(?:the)?\s*(?:decimal)?\s*(?:system)?$
|
\s*(?:in)?\s*(?:the)?\s*(?:decimal)?\s*(?:system)?$/ix;
|
||||||
/defined $1?$1:$3/eix;
|
|
||||||
|
|
||||||
# the 's' like in '400s'
|
|
||||||
my $multi = $+{'multi'};
|
|
||||||
# words that might describe the category
|
|
||||||
my $word = $+{'word'};
|
my $word = $+{'word'};
|
||||||
#output rows
|
|
||||||
my $output = {};
|
my $output = {};
|
||||||
|
|
||||||
if (defined $word) {
|
if (defined $word) {
|
||||||
|
@ -55,9 +50,8 @@ handle remainder => sub {
|
||||||
add_line($types{$_}, $output) for @results;
|
add_line($types{$_}, $output) for @results;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#$_ = sprintf "%03d", $+{'num'};
|
|
||||||
my $formatted_num = sprintf "%03d", $+{'num'};
|
my $formatted_num = sprintf "%03d", $+{'num'};
|
||||||
unless($multi) {
|
unless($+{'multi'}) {
|
||||||
add_line($formatted_num, $output)
|
add_line($formatted_num, $output)
|
||||||
}
|
}
|
||||||
elsif ($formatted_num =~ /\d00/) {
|
elsif ($formatted_num =~ /\d00/) {
|
||||||
|
|
Loading…
Reference in New Issue