Changeset 6967 for trunk/gsdl/perllib/classify.pm
- Timestamp:
- 2004-03-08T15:31:35+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify.pm
r6964 r6967 40 40 $next_classify_num = 1; 41 41 $collage = 0; 42 sub load_classifier_for_info { 43 my ($classifier) = shift @_; 44 45 # find the classifier 46 my $colclassname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, 47 "perllib/classify", 48 "${classifier}.pm"); 49 my $mainclassname = &util::filename_cat($ENV{'GSDLHOME'}, 50 "perllib/classify", 51 "${classifier}.pm"); 52 53 if (-e $colclassname) { require $colclassname; } 54 elsif (-e $mainclassname) { require $mainclassname; } 55 else { 56 &gsprintf(STDERR, "{classify.could_not_find_classifier}\n", $classifier) && die "\n"; 57 } 58 my ($classobj); 59 my $options = "-gsdlinfo"; 60 61 eval ("\$classobj = new \$classifier($options)"); 62 die "$@" if $@; 63 64 return $classobj; 65 } 42 66 43 67 sub load_classifiers { … … 66 90 my ($classobj); 67 91 68 # backwards compatability hack: if the classifier options are69 # in "x=y" format, convert them to parsearg ("-x y") format.70 my ($opt, $key, $value);71 92 my @newoptions; 72 93 … … 76 97 push @newoptions, "-verbosity", "2"; 77 98 99 # backwards compatability hack: if the classifier options are 100 # in "x=y" format, convert them to parsearg ("-x y") format. 101 my ($opt, $key, $value); 78 102 foreach $opt (@$classifyoption) { 79 103 if ($opt =~ /^(\w+)=(.*)$/) {
Note:
See TracChangeset
for help on using the changeset viewer.