|
From: Lachlan A. <lh...@us...> - 2003-10-11 02:35:53
|
Greetings all,
I have been testing the fuzzy algorithms, and can't get "speling" to=20
work, and I don't understand "regex".
"Speling" generates permuted forms of the query term, and check each=20
to see if it is in the database, like so:
// First transposes
// (these are really common)
initial =3D stripped;
char=09temp =3D initial[pos];
initial[pos] =3D initial[pos+1];
initial[pos+1] =3D temp;
if (!wordDB.Exists(initial)) // Seems weird, but this is=20
correct
=09words.Add(new String(initial));
// Now let's do deletions
The problem is that, whether or not the permutation is in the=20
database, wordDB.Exists(...) always seems to return -1 ("true"),=20
which means that the 'if' always fails (despite the comment saying it=20
is correct :)
"Regex" has problems with the meta characters being stripped out=20
before getting to the algorithm. Should the meta characters be part=20
of "extra_word_characters"? If so, what happens if "regex" and=20
"exact" are both specified in search_algorithms? When I set=20
"extra_word_characters=3D.*[^]\\$", the query ".*vers[ia].*" expands to=20
all the *numbers* in the word database.
Has anyone got speling or regex to work, or is the person who=20
wrote either of them still here?
Thanks!
Lachlan
--=20
lh...@us...
ht://Dig developer DownUnder (http://www.htdig.org)
|