mirror of
https://codeberg.org/scip/leo.git
synced 2025-12-16 20:21:03 +01:00
catch no $term
This commit is contained in:
11
Org.pm
11
Org.pm
@@ -7,7 +7,7 @@
|
||||
# or service marks of their respective holders.
|
||||
|
||||
package WWW::Dict::Leo::Org;
|
||||
$WWW::Dict::Leo::Org::VERSION = "1.43";
|
||||
$WWW::Dict::Leo::Org::VERSION = "1.44";
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
@@ -27,7 +27,7 @@ sub new {
|
||||
my %settings = (
|
||||
"-Host" => "pda.leo.org",
|
||||
"-Port" => 80,
|
||||
"-UserAgent" => "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9",
|
||||
"-UserAgent" => "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0",
|
||||
"-Proxy" => "",
|
||||
"-ProxyUser" => "",
|
||||
"-ProxyPass" => "",
|
||||
@@ -36,7 +36,6 @@ sub new {
|
||||
"-Morphology" => "standard", # none, forcedAll
|
||||
"-CharTolerance" => "relaxed", # fuzzy, exact
|
||||
"-Language" => "en", # en2de, de2fr, fr2de, de2es, es2de
|
||||
|
||||
"data" => {}, # the results
|
||||
"section" => [],
|
||||
"title" => "",
|
||||
@@ -58,6 +57,10 @@ sub new {
|
||||
sub translate {
|
||||
my($this, $term) = @_;
|
||||
|
||||
if (! $term) {
|
||||
croak "No term to translate given!";
|
||||
}
|
||||
|
||||
my $linecount = 0;
|
||||
my $maxsize = 0;
|
||||
my @match = ();
|
||||
@@ -542,6 +545,6 @@ Please don't forget to add debugging output!
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
1.43
|
||||
1.44
|
||||
|
||||
=cut
|
||||
|
||||
Reference in New Issue
Block a user