OpenSemanticLab / osw-python

GNU Affero General Public License v3.0
3 stars 2 forks source link

fix: wikitools.semantic_search does not except wtsite.WtSite as argument #13

Open LukasGold opened 1 year ago

LukasGold commented 1 year ago

wikitools.semantic_search and wikitools.prefix_search require a mwclient.Site object as argument "site", but only the protected "_site" attribute of WtSite objects is sufficient and not passing the WtSite object itself. This should be fixed so that no protected attribute needs to be accessed.

Example:

entities = wt.semantic_search(
        site=wtsite_obj._site,
        query=f"[[HasType::Category:OSW{str(category_uuid).replace('-', '')}]]",
        debug=debug,
    )