How can I edit the normalize function so that it also removes the punctuations and end of line characters?
This is the code sample below:
filename="bible.Sentences.15.txt"
def getData(filename):
with open(filename,'r') as f:
#converting to list where each element is an individual line of text file
lines=[line.rstrip() for line in f]
return lines
filename="bibleSentences.txt"
getData(filename)
def normalize(filename):
#converting all letters to lowercase
lowercase_lines=[x.lower() for x in getData(filename)]
print(lowercase_lines)
return lowercase_lines
normalize(filename)