Moved the function to the top.
parent
5bf752b88a
commit
c7921d77e1
|
@ -26,6 +26,16 @@ handle query_nowhitespace => sub {
|
|||
return scalar reverse $text;
|
||||
}
|
||||
|
||||
sub spacing {
|
||||
my $text = shift;
|
||||
$text =~ s/(\s*(?<!<)(?:[\+\-\^xX\*\/\%]|times|plus|minus|dividedby)+\s*)/ $1 /ig;
|
||||
$text =~ s/dividedby/divided by/ig;
|
||||
$text =~ s/(\d+?)((?:dozen|pi|gross|e|c))/$1 $2/ig;
|
||||
$text =~ s/\bc\b/speed of light/ig;
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
my $results_html;
|
||||
my $results_no_html;
|
||||
my ($query) = @_;
|
||||
|
@ -122,16 +132,6 @@ handle query_nowhitespace => sub {
|
|||
}
|
||||
}
|
||||
|
||||
sub spacing {
|
||||
my $text = shift;
|
||||
$text =~ s/(\s*(?<!<)(?:[\+\-\^xX\*\/\%]|times|plus|minus|dividedby)+\s*)/ $1 /ig;
|
||||
$text =~ s/dividedby/divided by/ig;
|
||||
$text =~ s/(\d+?)((?:dozen|pi|gross|e|c))/$1 $2/ig;
|
||||
$text =~ s/\bc\b/speed of light/ig;
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue