Moved the function to the top.

master
Jag Talon 2013-02-18 13:51:34 -05:00
parent 5bf752b88a
commit c7921d77e1
1 changed files with 10 additions and 10 deletions

View File

@ -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;
};