import wikipedia
print(wikipedia.summary("Tomato", sentences=3))
Why does this code return a disambiguation error with "tom tom" and not just a summmary/disambiguation error to the entry "tomato"? The search term is clearly not tom tom or am I missing something here? Why doesnt this work?
Searching for
"Tomato"leads to the suggestion"tom tom". Not sure why... In any case, you can disableauto_suggestinwikipedia.summary:The output is
You can see that searching for
"Tomato"suggests"tom tom"using thewikipedia.searchfunction:The
suggestionis"tom tom", andresultsis a list of titles that are closely related to tomato.