T
Tore Aursand
Hi all!
I'm stumped on this one: I have an application where I need to refine the
search mechanism. The concept is quite simple: Get a string, convert it
to separate words, count (and "score") each word for each document, and
then display the result based on the score;
my $query = 'A B C D';
my @words = split( /\s+/, $query );
foreach ( @documents ) {
# ...
}
I need to refine it, as said. I want a higher score for word sequences,
and in a particular order. For the example above ('A B C D'), I want to
match in this order:
1. A B C D
2. A B C
3. B C D
4. A B
5. C D
6. A C
7. B D
9. A D
9. A
10. B
11. C
12. D
Anyone know of a module which can accomplis this? I really haven't tried
with anything yet, 'cause I have no clue on how to do it. The closest
thing I've been, has been with the Algorithm:
ermute module. It doesn't
give me what I want "out of the box", though...
Any ideas?
I'm stumped on this one: I have an application where I need to refine the
search mechanism. The concept is quite simple: Get a string, convert it
to separate words, count (and "score") each word for each document, and
then display the result based on the score;
my $query = 'A B C D';
my @words = split( /\s+/, $query );
foreach ( @documents ) {
# ...
}
I need to refine it, as said. I want a higher score for word sequences,
and in a particular order. For the example above ('A B C D'), I want to
match in this order:
1. A B C D
2. A B C
3. B C D
4. A B
5. C D
6. A C
7. B D
9. A D
9. A
10. B
11. C
12. D
Anyone know of a module which can accomplis this? I really haven't tried
with anything yet, 'cause I have no clue on how to do it. The closest
thing I've been, has been with the Algorithm:
give me what I want "out of the box", though...
Any ideas?