Hi Liam,
I spent some more time with the XQFT thesaurus specification, and I decided it would be too invasive to make the thesaurus input fully dynamic. There are simply too many rules and optimizations that depend on a static source.
It would certainly be easier to define a new helper function in the Full-Text Module instead. The returned strings could then be used as input for the FT expressions:
let $thes := <thesaurus>...</thesaurus> let $term := 'happy' let $relation := 'RT' let $levels := 1 to 10 let $terms := ft:thesaurus($thes, $term, $relation, $levels) return 'lucky' contains text { $terms }
Do you think that could be helpful? Christian
On Thu, May 27, 2021 at 5:35 PM Liam R. E. Quin liam@fromoldbooks.org wrote:
On Thu, 2021-05-27 at 14:35 +0200, Christian Grün wrote:
Hi Liam,
That would certainly be possible. The major challenge will be to make it effiicent.
Thank you for replying!
It might be that i can solve my need differently - i want to implement a Google-search-like syntax for a Web site - "very tall (boy|youth|young man) wearing (green|lemon)" (where "..." indicates a phrase search)
One way might be to create the multiplicative expansion of every combination and search for those, maybe only in text containing "very tall" and "wearing" where constant strings are supplied.
I had thought another way might be to create a thesaurus making boy, youth, young man, be synonyms, and apply that to the search, but then found i needed to write out a thesaurus file for every such query.
-- Liam Quin, https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org