Page 1 of 1

Way to add optional second thesaurus?

Posted: Wed Apr 02, 2025 11:31 pm
by rjshelq
I'm using Webinator 27.2.0 and want to use my own equivalents file all of the time, and also allow users to add something such as a tilde to incorporate the standard Built-In equivalents file in addition to my own equivalents file.

Currently I have created the new equivalents file, have run backref, and have added the following lines near the end of the fpar function in my search script:

<apicp keepeqvs 1>
<apicp eqprefix "/usr/local/morph3/texis/equiv.d/MyEquivs">

That seems to have accomplished the first step, since my new equivalents seem to be working as expected.

Now, is there some way to add a feature which will allow a user to add something such as a tilde in front of specific terms which they would like to further expand using the original Built-In thesaurus in addition to MyEquivs?

Or, if that is not possible, is there a way to add a feature in the Advanced Settings form to additionally turn on the Built-In thesaurus in addition to MyEquivs for the entire query?

Re: Way to add optional second thesaurus?

Posted: Thu Apr 03, 2025 11:48 am
by John
There is a search setting for which thesaurus to use as the Main Thesaurus and the Secondary Thesaurus, so you shouldn't need to hardcode that into the scripts so that script updates won't break it.

You could add a setting that would toggle whether the secondary thesaurus (ueqprefix) is enabled or not, and that would be a script edit.

Re: Way to add optional second thesaurus?

Posted: Thu Apr 03, 2025 1:18 pm
by rjshelq
Okay. I've removed those changes in fpar and moved my equivalents file back to the Webinator Admin Panel. But I still need some guidance on how to modify the script to make it possible to use something like the tilde to additionally enable the original Built-In thesaurus for specific searches. Can you give me some detailed guidance on how that could be accomplished?

Re: Way to add optional second thesaurus?

Posted: Sun Apr 06, 2025 10:34 am
by rjshelq
I have not yet been able to find a way to have one thesaurus be always active while only enabling the second thesaurus when a special indicator such as a tilde is in front of a specific word.

Is there a way to have the primary and secondary thesaurus use separate "rules" so the the primary thesaurus is always active, but the secondary thesaurus only becomes active when a word is preceded by a special character such as tilde?

Re: Way to add optional second thesaurus?

Posted: Mon Apr 07, 2025 9:43 pm
by John
No, the the primary and secondary thesaurus are combined before the query is processed. You would only be able to optionally merge the secondary thesaurus in or not for the entire query.

Re: Way to add optional second thesaurus?

Posted: Tue Apr 08, 2025 9:38 pm
by rjshelq
Thank you for your kind reply John.

For anyone searching for a similar solution, here's what I ended up doing:

Since Webinator does not have the native skill to allow me to have a list of always-imposed full-time equivalents (largely spelling variations) and also a separate thesaurus list (the full built-in thesaurus which has alternate terms) turned on for individual words with a tilde, I have now changed course and am now pre-processing the user's search form entries using perl to include the full-time equivalents in the Webinator-friendly comma-separated format using parentheses such as (color,colour) or (Khusraw,Khusrau,Khusrow,Khusru) such that these equivalent lists are inserted in the user's query prior to submission to Webinator. This seems to totally resolve this issue and is very easy to implement.