give spelling suggestions for 3 hits or less

Post Reply
rjshelq
Posts: 82
Joined: Thu Nov 17, 2005 3:25 pm

give spelling suggestions for 3 hits or less

Post by rjshelq »

With Webinator 6.1, I'd like to offer spelling suggestions whenever there are three hits or less.

I tried changing:

<CASE lte 5><!-- 5 or fewer hits -->
<if "Y" eq $SSc_spelling>
<if 0 eq $jump and $loop eq 1>

to:
<CASE lte 5><!-- 5 or fewer hits -->
<if "Y" eq $SSc_spelling>
<if 0 eq $jump and $loop lte 3>

but that didn't work.

Could you please show me how to get spelling suggestions for 3 or less hits?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

give spelling suggestions for 3 hits or less

Post by mark »

Try
<CASE lte 3><!-- 3 or fewer hits -->
rjshelq
Posts: 82
Joined: Thu Nov 17, 2005 3:25 pm

give spelling suggestions for 3 hits or less

Post by rjshelq »

Thanks for the quick reply, but that didn't seem to help.

Currently, Webinator only offers spelling suggestions whenever there is only 0 or 1 hit. I'd like to increase that number to 3 (or perhaps more).

The code in the Webinator 6.1 search script looks like this:

<CASE lte 5><!-- 5 or fewer hits -->
<if "Y" eq $SSc_spelling>
<if 0 eq $jump and $loop eq 1>
<rex row "[^\space]+" $txtquery></rex>
<if $loop lte 5><!-- 5 or fewer query words -->
<SpellChecker nhits=1>
</if>
</if>
</if>

Changing <if 0 eq $jump and $loop eq 1> to <if 0 eq $jump and $loop lte 3> (and/or the change you suggested above) does not result in spelling suggestions for any more than 1 hit.

Can you suggest what to change to get spelling suggestions for more than 1 hit?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

give spelling suggestions for 3 hits or less

Post by mark »

The <if 0 eq $jump and $loop eq 1> line controls where to print the suggestions, only before the first hit on the first page. Do not change this.

The <CASE lte 5> controls how many matches for suggestions. Change 5 to your desired value.

The <if $loop lte 5> prevents suggestions if the query has more than 5 words.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

give spelling suggestions for 3 hits or less

Post by mark »

re John's comment. You could change <SpellChecker nhits=1> to <SpellChecker nhits=0> to allow noisier and possibly redundant suggestions.
rjshelq
Posts: 82
Joined: Thu Nov 17, 2005 3:25 pm

give spelling suggestions for 3 hits or less

Post by rjshelq »

Thanks guys...John seems to have hit the nail on the head... Aspell was indeed the limitation.
Post Reply