Code
QUESTION=input("") #Albert Einstein RESULTS = wikipedia.search(str(QUESTION))#['einstein family', 'hans albert einstein', 'albert einstein', 'religious and philosophical views of albert einstein', "albert einstein's brain", 'albert einstein house', 'elsa einstein', 'albert einstein memorial', 'albert einstein college of medicine', 'bernhard caesar einstein'] for i in range(len(RESULTS)): print(RESULTS[i])#einstein family RESULT = wikipedia.summary(str(RESULTS[i]))#PAGE ID "EPSTEIN FAMILY" DOES NOT MATCH ANY PAGES. TRY ANOTHER ID!
It for some reason changes einstein family to epstein family and i have no idea why does anyone know why this error occurs?
Advertisement
Answer
Change the
RESULT = wikipedia.summary(str(RESULTS[i]))
to
RESULT = wikipedia.summary(str(RESULTS[i]), auto_suggest=False)
I was looking through the wikipedia.py
file and found that auto_suggest
can change your RESULTS[i]
to a close approximation and so by turning it to False
it stops that and gives me the correct answer.
As for the details, please check Wikipedia API.