MycroftAI / skill-wiki

Query Wikipedia articles
https://mycroft.ai/skills
Apache License 2.0
18 stars 33 forks source link

Major refactor including switch to pymediawiki #70

Closed krisgesling closed 3 years ago

krisgesling commented 3 years ago

Description

In the search for better images it was clear that the existing wikipedia python package being used was abandonware. pymediawiki is one of the projects that came out of it and provides a lot of the same functionality but with quite a different wrapper.

This PR extends on #69 though primarily replaces it:

Future work

Type of PR

Testing

VK tests

Documentation

Docstrings added all round

CLA

krisgesling commented 3 years ago

Caught another bug while I was testing these changes.

Disambiguation results can refer to other disambiguation pages :loop:

This was raising a DisambiguationError for some queries. So the new function recursively processes disambiguation results to fetch a valid page that is a likely strong result to the original query. It also refers back to the original or "top-level" disambiguation page title as this would best reflect the users question.