Python Regex split text file into sentences and append to a list
Question: I've been trying to solve this problem without using any external modules, but
only inbuilt python Regex. I've got this so far. The file i'm reading is a
.txt file

    
    
    import re
    def GetText(filename):
    print('Opening file...')
    
    text_file= open(filename,'r')
    lines = text_file.readlines() #each line is appended to a list
    
    with text_file:
        one_string= text_file.read().replace('\n', '')
    print(one_string)
    


Answer: Instead of reading the whole file a line at atime why not read it all in one
go and then split based on full stops (periods) in order to get sentences...
ie:

    
    
    text_file= open(filename,'r')
    data=text_file.read()
    listOfSentences = data.split(".")
    

