Skip to content

Instantly share code, notes, and snippets.

@robgon-art
Created January 8, 2022 23:25
Show Gist options
  • Save robgon-art/2ac0974c5d143c5b3d43c0ffa5497812 to your computer and use it in GitHub Desktop.
Save robgon-art/2ac0974c5d143c5b3d43c0ffa5497812 to your computer and use it in GitHub Desktop.
import wikipedia
print(wikipedia.search("Albert Einstein")[:5])
def check_in_wiki(name):
name_parts = name.split()
wiki_results = wikipedia.search(name)
for w in wiki_results:
w = w.lower()
match_all_parts = True
for n in name_parts:
n = n.lower()
if n not in w:
match_all_parts = False
break
if match_all_parts:
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment