Last active
April 18, 2020 18:21
-
-
Save mlai-demo/952e4d098069d107c1c2af7d85738d2f 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
with open('all_abstracts_lemmas.txt', 'r', encoding = "utf-8") as f: | |
lemma_text = f.read() | |
n = 4 | |
word = r'\W*([\w]+)' | |
text_search_como = re.findall(r'{}\W*{}{}'.format(word*n,'(?:comorbid|comorbidity)',word*n), | |
lemma_text) | |
flatten_text_search = [element for sublist in text_search_como for element in sublist | |
if len(element) >3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment