Ignore:
Timestamp:
2004-01-22T14:17:30+13:00 (20 years ago)
Author:
kjdon
Message:

Fiddled around with segmenting for chinese text. Haven't changed how the
segmentation is done, or what character ranges are used.
But when its done is now controlled by the collect.cfg. There is a new
option, separate_cjk, values true or false, default false. Segmentation
is only done if this is set to true. This is passed as a global option to
all plugins by the import.pl script, so the user just needs to add it
once to the config file, not as an option to all plugins.
The queryaction uses this option too to determine whether or not to segment
the query.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugin.pm

    r6407 r6584  
    4141}
    4242
    43 
     43#globaloptions contains any options that should be passed to all plugins
    4444sub load_plugins {
    4545    my ($plugin_list) = shift @_;
    46     ($verbosity, $outhandle, $failhandle) = @_; # globals
     46    ($verbosity, $outhandle, $failhandle, $globaloptions) = @_; # globals
    4747    my @plugin_objects = ();
    4848
     
    5050    $outhandle = STDERR unless defined $outhandle;
    5151    $failhandle = STDERR unless defined $failhandle;
     52
     53    map { $_ = "\"$_\""; } @$globaloptions;
     54    my $globals = join (",", @$globaloptions);
    5255
    5356    foreach $pluginoptions (@$plugin_list) {
     
    7073    map { $_ = "\"$_\""; } @$pluginoptions;
    7174    my $options = join (",", @$pluginoptions);
     75    if ($globals) {
     76        if (@$pluginoptions) {
     77        $options .= ",";
     78        }
     79        $options .= "$globals";
     80    }
    7281    $options =~ s/\$/\\\$/g;
     82   
    7383    eval ("\$plugobj = new \$pluginname($options)");
    7484    die "$@" if $@;
Note: See TracChangeset for help on using the changeset viewer.