Created
January 8, 2022 23:25
-
-
Save robgon-art/2ac0974c5d143c5b3d43c0ffa5497812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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