Show
Ignore:
Timestamp:
30.08.2008 07:35:20 (11 years ago)
Author:
kjdon
Message:

changed way cjk separation is done. Not done in plugins any more, but is now an indexoption. cnseg called from filter_text method. generate_index_options sets up the field in buildproc

Files:
1 modified

Legend:

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

    r16379 r17110  
    148148     
    149149    $self->generate_index_list(); 
    150     $self->generate_index_options(); 
    151  
     150  
    152151    # sort out subcollection indexes 
    153152    if (defined $self->{'collect_cfg'}->{'indexsubcollections'}) { 
     
    216215    die "$@" if $@; 
    217216 
     217     
     218   $self->generate_index_options(); 
     219 
    218220    if (!$self->{'debug'} && !$self->{'keepold'}) { 
    219221    # remove any old builds 
     
    234236} 
    235237 
     238sub generate_index_options { 
     239    my $self = shift (@_); 
     240 
     241    my $separate_cjk = 0; 
     242     
     243    if (defined($self->{'collect_cfg'}->{'indexoptions'})) { 
     244    foreach my $option (@{$self->{'collect_cfg'}->{'indexoptions'}}) { 
     245        if ($option =~ /separate_cjk/) { 
     246        $separate_cjk = 1; 
     247        } 
     248    } 
     249    } 
     250    # set this for building 
     251    $self->{'buildproc'}->set_separate_cjk($separate_cjk); 
     252    # record it for build.cfg 
     253    $self->{'separate_cjk'} = $separate_cjk; 
     254} 
     255  
    236256sub set_sections_index_document_metadata { 
    237257    my $self = shift (@_); 
     
    429449    $build_cfg->{'indexstem'} = &util::get_dirsep_tail($self->{'collection'}); 
    430450    $build_cfg->{'stemindexes'} = $self->{'stemindexes'}; 
     451    if ($self->{'separate_cjk'}) { 
     452    $build_cfg->{'separate_cjk'} = "true"; 
     453    } 
    431454     
    432455    # store the number of documents and number of bytes