|
From: <jgr...@us...> - 2003-10-30 14:48:38
|
Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv2846/Classifier
Modified Files:
Bayes.pm
Log Message:
Merge patch that fixes a problem I introduced wit magnet_match_helper__ crashing in Japanese
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.217
retrieving revision 1.218
diff -C2 -d -r1.217 -r1.218
*** Bayes.pm 28 Oct 2003 19:39:48 -0000 1.217
--- Bayes.pm 30 Oct 2003 14:48:28 -0000 1.218
***************
*** 886,890 ****
$match = lc($match);
! for my $magnet (sort keys %{$self->{magnets__}{$bucket}{$type}}) {
$magnet = lc($magnet);
--- 886,902 ----
$match = lc($match);
! # In Japanese and Korean mode, disable locale.
! # Sorting Japanese and Korean with "use locale" is memory and time consuming,
! # and may cause perl crash.
!
! my @magnets;
! if ( $self->module_config_( 'html', 'language' ) =~ /^Nihongo|Korean$/ ) {
! no locale;
! @magnets = sort keys %{$self->{magnets__}{$bucket}{$type}};
! } else {
! @magnets = sort keys %{$self->{magnets__}{$bucket}{$type}};
! }
!
! for my $magnet (@magnets) {
$magnet = lc($magnet);
***************
*** 896,900 ****
return 1;
! }
}
}
--- 908,912 ----
return 1;
! }
}
}
***************
*** 919,928 ****
my ( $self, $match, $bucket, $type ) = @_;
! if ( $self->module_config_( 'html', 'language' ) =~ /^Nihongo|Korean$/ ) {
! no locale;
! return $self->magnet_match_helper__( $match, $bucket, $type );
! } else {
! return $self->magnet_match_helper__( $match, $bucket, $type );
! }
}
--- 931,935 ----
my ( $self, $match, $bucket, $type ) = @_;
! return $self->magnet_match_helper__( $match, $bucket, $type );
}
***************
*** 2059,2074 ****
foreach my $file (@files) {
$self->{parser__}->parse_file( $file, $self->module_config_( 'html', 'language' ) );
!
! # In Japanese mode, disable locale.
! # Sorting Japanese with "use locale" is memory and time consuming,
! # and may cause perl crash.
!
! # Disable the locale in Korean mode, too.
! if ( $self->module_config_( 'html', 'language' ) =~ /^Nihongo|Korean$/ ) {
! no locale;
! $self->add_words_to_bucket__( $bucket, 1 );
! } else {
! $self->add_words_to_bucket__( $bucket, 1 );
! }
}
--- 2066,2070 ----
foreach my $file (@files) {
$self->{parser__}->parse_file( $file, $self->module_config_( 'html', 'language' ) );
! $self->add_words_to_bucket__( $bucket, 1 );
}
***************
*** 2120,2136 ****
$self->{parser__}->parse_file( $file, $self->module_config_( 'html', 'language' ) );
! # In Japanese mode, disable locale.
! # Sorting Japanese with "use locale" is memory and time consuming,
! # and may cause perl crash.
!
! # Disable the locale in Korean mode, too.
!
! if ( $self->module_config_( 'html', 'language' ) =~ /^Nihongo|Korean$/ ) {
! no locale;
! $self->add_words_to_bucket__( $bucket, -1 );
! } else {
! $self->add_words_to_bucket__( $bucket, -1 );
! }
!
$self->load_word_matrix_();
--- 2116,2120 ----
$self->{parser__}->parse_file( $file, $self->module_config_( 'html', 'language' ) );
! $self->add_words_to_bucket__( $bucket, -1 );
$self->load_word_matrix_();
|