Changeset 6584
- Timestamp:
- 2004-01-22T14:17:30+13:00 (20 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/import.pl
r6407 r6584 348 348 # options must be known before we read the collect.cfg)) 349 349 my $plugins = []; 350 my @global_opts = (); 351 350 352 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 351 353 if (-e $configfilename) { … … 414 416 $gli = 1; 415 417 } 418 419 # global plugin stuff 420 if (defined $collectcfg->{'separate_cjk'}&& $collectcfg->{'separate_cjk'} =~ /^true$/i) { 421 push @global_opts, "-separate_cjk"; 422 } 423 416 424 417 425 } else { … … 433 441 434 442 # load all the plugins 435 $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog );443 $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts); 436 444 if (scalar(@$pluginfo) == 0) { 437 445 print $out &lookup_string("{import.no_plugins_loaded}") . "\n"; -
trunk/gsdl/perllib/colcfg.pm
r4818 r6584 44 44 # {'buildtype'}->string 45 45 # {'maxnumeric'}->string 46 # {'separate_cjk'}->string 46 47 47 48 # {'maintainer'}->array of strings … … 76 77 q/verbosity|allclassifications|OIDtype|maxdocs|/ . 77 78 q/groupsize|sortmeta|debug|mode|create_images|/ . 78 q/maxnumeric )$/,79 q/maxnumeric|separate_cjk)$/, 79 80 q/(maintainer|languages|indexsubcollections|/ . 80 81 q/indexes|dontbuild|dontgdbm|mirror|phind|levels|searchtype)$/, … … 91 92 q/archivedir|cachedir|builddir|removeold|/ . 92 93 q/textcompress|buildtype|collectdir|no_text|/ . 93 q/allclassifications|maxnumeric )$/,94 q/allclassifications|maxnumeric|separate_cjk)$/, 94 95 q/^(maintainer|languages|indexsubcollections|/ . 95 96 q/indexes|dontbuild|dontgdbm|levels|searchtype)$/, -
trunk/gsdl/perllib/mgbuilder.pm
r6545 r6584 151 151 152 152 # load all the plugins 153 $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $verbosity, $outhandle, $failhandle); 153 154 #build up the extra global options for the plugins 155 my @global_opts = (); 156 if (defined $self->{'collect_cfg'}->{'separate_cjk'} && $self->{'collect_cfg'}->{'separate_cjk'} =~ /^true$/i) { 157 push @global_opts, "-separate_cjk"; 158 } 159 $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $verbosity, $outhandle, $failhandle, \@global_opts); 154 160 if (scalar(@{$self->{'pluginfo'}}) == 0) { 155 161 print $outhandle "No plugins were loaded.\n"; -
trunk/gsdl/perllib/mgppbuilder.pm
r6545 r6584 211 211 print $outhandle "doclevel = ". $self->{'doc_level'}."\n"; 212 212 # get the list of plugins for this collection 213 214 #build up the extra global options for the plugins 215 my @global_opts = (); 216 if (defined $self->{'collect_cfg'}->{'separate_cjk'} && $self->{'collect_cfg'}->{'separate_cjk'} =~ /^true$/i) { 217 push @global_opts, "-separate_cjk"; 218 } 219 213 220 my $plugins = []; 214 221 if (defined $self->{'collect_cfg'}->{'plugin'}) { … … 217 224 218 225 # load all the plugins 219 $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $verbosity, $outhandle );226 $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $verbosity, $outhandle, \@global_opts); 220 227 if (scalar(@{$self->{'pluginfo'}}) == 0) { 221 228 print $outhandle "No plugins were loaded.\n"; -
trunk/gsdl/perllib/plugin.pm
r6407 r6584 41 41 } 42 42 43 43 #globaloptions contains any options that should be passed to all plugins 44 44 sub load_plugins { 45 45 my ($plugin_list) = shift @_; 46 ($verbosity, $outhandle, $failhandle ) = @_; # globals46 ($verbosity, $outhandle, $failhandle, $globaloptions) = @_; # globals 47 47 my @plugin_objects = (); 48 48 … … 50 50 $outhandle = STDERR unless defined $outhandle; 51 51 $failhandle = STDERR unless defined $failhandle; 52 53 map { $_ = "\"$_\""; } @$globaloptions; 54 my $globals = join (",", @$globaloptions); 52 55 53 56 foreach $pluginoptions (@$plugin_list) { … … 70 73 map { $_ = "\"$_\""; } @$pluginoptions; 71 74 my $options = join (",", @$pluginoptions); 75 if ($globals) { 76 if (@$pluginoptions) { 77 $options .= ","; 78 } 79 $options .= "$globals"; 80 } 72 81 $options =~ s/\$/\\\$/g; 82 73 83 eval ("\$plugobj = new \$pluginname($options)"); 74 84 die "$@" if $@; -
trunk/gsdl/perllib/plugins/BasPlug.pm
r6408 r6584 405 405 qq^maximum_century/-?\\d{1,2}( ?B\\.C\\.E\\.)?/-1^, \$self->{'max_century'}, 406 406 q^cover_image^, \$self->{'cover_image'}, 407 q^separate_cjk^, \$self->{'separate_cjk'}, 407 408 "allow_extra_options")) { 408 409 … … 615 616 $reader->read_file ($textref); 616 617 617 if ($language eq "zh") { 618 #Now segments chinese if the separate_cjk option is set 619 if ($self->{'separate_cjk'}) { 618 620 # segment the Chinese words 619 621 $$textref = &cnseg::segment($$textref); -
trunk/gsdl/src/colservr/collectserver.cpp
r5868 r6584 101 101 collectinfo.searchTypes = cfgline; 102 102 } 103 103 else if (key == "separate_cjk") { 104 if (value == "true") collectinfo.isSegmented = true; 105 else collectinfo.isSegmented = false; 106 } 104 107 // What have we set in our collect.cfg file : document or collection ? 105 108 else if (key == "authenticate") collectinfo.authenticate = value; -
trunk/gsdl/src/recpt/comtypes.cpp
r5024 r6584 53 53 isPublic=true; 54 54 isBeta=false; 55 isSegmented=false; 55 56 languages.erase(languages.begin(), languages.end()); 56 57 ccsCols.erase(ccsCols.begin(), ccsCols.end()); -
trunk/gsdl/src/recpt/comtypes.h
r5024 r6584 90 90 bool isPublic; 91 91 bool isBeta; 92 bool isSegmented; 92 93 unsigned long buildDate; 93 94 text_tarray ccsCols; // empty if collection does not use cross-collection searching -
trunk/gsdl/src/recpt/documentaction.cpp
r5917 r6584 1008 1008 1009 1009 if (!args["q"].empty() && args.getintarg("hl")) { 1010 1011 ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, collection, logout); 1012 bool segment = false; 1013 if (cinfo != NULL) { 1014 segment = cinfo->isSegmented; 1015 } 1010 1016 FilterRequest_t request; 1011 1017 comerror_t err; 1012 1018 request.filterResultOptions = FRmatchTerms; 1013 1019 text_t formattedstring = args["q"]; 1014 format_querystring (formattedstring, args.getintarg("b") );1020 format_querystring (formattedstring, args.getintarg("b"), segment); 1015 1021 set_queryfilter_options (request, formattedstring, args); 1016 1022 collectproto->filter (args["c"], request, queryresponse, err, logout); -
trunk/gsdl/src/recpt/queryaction.cpp
r5762 r6584 632 632 633 633 // sets the selection box macros _hselection_, _jselection_, _nselection_ _gselection_, fqfselection_ 634 void queryaction::set_option_macro (const text_t ¯oname, text_t current_value, bool display_single, bool add_js_update, 635 const FilterOption_t &option, displayclass &disp) { 634 void queryaction::set_option_macro (const text_t ¯oname, 635 text_t current_value, 636 bool display_single, 637 bool add_js_update, 638 const FilterOption_t &option, 639 displayclass &disp) { 636 640 637 641 if (option.validValues.empty()) return; … … 1082 1086 isapprox isApprox = Exact; 1083 1087 1088 // what to do about segmentation for multiple colls?? 1089 bool segment = false; 1084 1090 text_t formattedstring = ""; 1085 get_formatted_query_string(formattedstring, args, disp, logout);1091 get_formatted_query_string(formattedstring, segment, args, disp, logout); 1086 1092 1087 1093 if (formattedstring.empty()) { … … 1288 1294 } 1289 1295 1296 bool segment = cinfo->isSegmented; 1290 1297 browserclass *bptr = browsers->getbrowser (browsertype); 1291 1298 … … 1307 1314 request.filterResultOptions = FROID | FRmetadata | FRtermFreq; 1308 1315 text_t formattedstring = ""; 1309 get_formatted_query_string(formattedstring, args, disp, logout);1316 get_formatted_query_string(formattedstring, segment, args, disp, logout); 1310 1317 1311 1318 … … 1354 1361 // also adds dates if appropriate in text search 1355 1362 void queryaction::get_formatted_query_string (text_t &formattedstring, 1363 bool segment, 1356 1364 cgiargsclass &args, 1357 1365 displayclass &disp, … … 1360 1368 formattedstring = args["q"]; 1361 1369 // remove & | ! for simple search, insert spaces for chinese 1362 format_querystring (formattedstring, args.getintarg("b") );1370 format_querystring (formattedstring, args.getintarg("b"), segment); 1363 1371 if (args["ct"]=="1") { // mgpp - we need to add in the field info 1364 1372 format_field_info(formattedstring, args["fqf"]); -
trunk/gsdl/src/recpt/queryaction.h
r4937 r6584 73 73 int numDocs, isapprox isApprox); 74 74 75 void get_formatted_query_string (text_t &formattedstring, cgiargsclass &args, 75 void get_formatted_query_string (text_t &formattedstring, bool segment, 76 cgiargsclass &args, 76 77 displayclass &disp, ostream &logout); 77 78 void define_query_interface(displayclass &disp, cgiargsclass &args, -
trunk/gsdl/src/recpt/querytools.cpp
r4757 r6584 154 154 } 155 155 156 void format_querystring (text_t &querystring, int querymode ) {156 void format_querystring (text_t &querystring, int querymode, bool segment) { 157 157 text_t formattedstring; 158 158 159 if (querymode == 1 && !segment) return; 160 159 161 text_t::const_iterator here = querystring.begin(); 160 162 text_t::const_iterator end = querystring.end(); … … 171 173 *here == '!' || *here == '&')) { 172 174 formattedstring.push_back(' '); 173 } else {175 } else if (segment) { 174 176 if ((*here >= 0x4e00 && *here <= 0x9fa5) || 175 177 (*here >= 0xf900 && *here <= 0xfa2d)) { … … 184 186 space = false; 185 187 } 188 189 } else { 190 formattedstring.push_back (*here); 186 191 } 187 192 here ++; -
trunk/gsdl/src/recpt/querytools.h
r4757 r6584 40 40 void set_more_queryfilter_options (FilterRequest_t &request, cgiargsclass &args); 41 41 42 void format_querystring (text_t &querystring, int querymode );42 void format_querystring (text_t &querystring, int querymode, bool segment); 43 43 44 44 void add_dates(text_t &querystring, int startdate, int enddate,
Note:
See TracChangeset
for help on using the changeset viewer.