How to use WordNet thesaurus in Whoosh

Viewed 146

I'm new to Whoosh and I want to expand search queries using synonyms, similar to what Elasticsearch does with its Synonym Token Filters. The most similar thing I could find is the Thesaurus class from whoosh.lang.wordnet. I've already downloaded and copied my wn_s.pl file, but now I'm stuck on how to get it to work with Whoosh. I couldn't find any Thesaurus or whoosh.lang.wordnet usage anywhere in the Whoosh source code nor any helpful Google results about it. Not even the Whoosh docs has more information about it except for help with the module's functions and the Thesaurus class itself.

So how do I load and use the WordNet database in Whoosh? I'm using Whoosh 2.7.4 on Python 3.6.

0 Answers
Related