projects
/
koha.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d5cd90b
)
Bug Fixing MT 2095 : Add_excepti.al Search broken on QueryStemming
author
root
<root@descartes.biblibre.com>
Fri, 16 Oct 2009 21:40:13 +0000
(23:40 +0200)
committer
Henri-Damien LAURENT
<henridamien.laurent@biblibre.com>
Tue, 20 Oct 2009 10:22:15 +0000
(12:22 +0200)
C4/Search.pm
patch
|
blob
|
history
diff --git
a/C4/Search.pm
b/C4/Search.pm
index
33c79fc
..
010f59f
100644
(file)
--- a/
C4/Search.pm
+++ b/
C4/Search.pm
@@
-695,7
+695,7
@@
sub _detect_truncation {
# STEMMING
sub _build_stemmed_operand {
my ($operand,$lang) = @_;
# STEMMING
sub _build_stemmed_operand {
my ($operand,$lang) = @_;
- require Lingua::Stem::Snowball;
+ require Lingua::Stem::Snowball
;
my $stemmed_operand;
# If operand contains a digit, it is almost certainly an identifier, and should
my $stemmed_operand;
# If operand contains a digit, it is almost certainly an identifier, and should
@@
-706,18
+706,10
@@
sub _build_stemmed_operand {
return $operand if $operand =~ /\d/;
# FIXME: the locale should be set based on the user's language and/or search choice
return $operand if $operand =~ /\d/;
# FIXME: the locale should be set based on the user's language and/or search choice
+ warn "$lang";
my $stemmer = Lingua::Stem::Snowball->new( lang => $lang,
encoding => "UTF-8" );
my $stemmer = Lingua::Stem::Snowball->new( lang => $lang,
encoding => "UTF-8" );
-# FIXME: these should be stored in the db so the librarian can modify the behavior
-# Lingua::Stem can't add exceptions
-# $stemmer->add_exceptions(
-# {
-# 'and' => 'and',
-# 'or' => 'or',
-# 'not' => 'not',
-# }
-# );
my @words = split( / /, $operand );
my @stems = $stemmer->stem(\@words);
for my $stem (@stems) {
my @words = split( / /, $operand );
my @stems = $stemmer->stem(\@words);
for my $stem (@stems) {