Page 1 of 1

give spelling suggestions for 3 hits or less

Posted: Tue Jun 05, 2012 5:43 pm
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?

give spelling suggestions for 3 hits or less

Posted: Wed Jun 06, 2012 10:17 am
by mark
Try
<CASE lte 3><!-- 3 or fewer hits -->

give spelling suggestions for 3 hits or less

Posted: Wed Jun 06, 2012 5:02 pm
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?

give spelling suggestions for 3 hits or less

Posted: Wed Jun 06, 2012 5:46 pm
by John
Another issue you may be seeing is that if there is more than one hit then the spell check dictionaries will contain the words from the queries, so it will not make alternate suggestions. You would also need to change the dowalk script so when it creates the dictionaries it creates one with only words that occur more than 3 times by changing or adding the minWordCount parameter to SpellMakeOneDict.

give spelling suggestions for 3 hits or less

Posted: Wed Jun 06, 2012 5:50 pm
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.

give spelling suggestions for 3 hits or less

Posted: Wed Jun 06, 2012 5:55 pm
by mark
re John's comment. You could change <SpellChecker nhits=1> to <SpellChecker nhits=0> to allow noisier and possibly redundant suggestions.

give spelling suggestions for 3 hits or less

Posted: Fri Jun 08, 2012 10:30 pm
by rjshelq
Thanks guys...John seems to have hit the nail on the head... Aspell was indeed the limitation.