This:
import re
title = 'Decreased glucose-6-phosphate dehydrogenase activity along with oxidative stress affects visual contrast sensitivity in alcoholics.'
words = list(filter(None, re.split('\W+', title)))
for word in words:
print(word)
results in:
Decreased
glucose
6
phosphate
dehydrogenase
activity
along
with
oxidative
stress
affects
visual
contrast
sensitivity
in
alcoholics
Ideally, I would like to prevent the splitting of words like:
glucose-6-phosphate
Is there a better way to obtain separate words of a sentence like this in Python? Should I adopt the regular expression or is there something OOTB? Thanks.