# Reading an article and
# breaking it up into sentences.

# First loop: reading the file, and turning the
# series of lines into a list of words. 
words = []  # Start with the empty list
inFile = open('article.txt', 'r') # Open the file. article.txt has to be
        # in same folder as this program, or both on the Desktop.
line = inFile.readline() # Puts the first line of the file into variable line
while line != '':  # So long as we have a valid line (not at end of file)
    # Process the line. Here, line.split() produces a list of the words in
    # the line. We concatenate that list at the end of our list of words.
    words = words + line.split()
    line = inFile.readline() # Get the next line
inFile.close() # At end of file, let go of it. 

# Second loop: Look at our list of words, and put them together into
# sentences. 
sentence = ''  # Start out with current sentence being empty. 
for word in words: # Read through list of words in order.
    # Put the next word at end of current sentence
    sentence = sentence + ' ' + word 
    if '.' in word:  # Period means end of sentence.
        print sentence, '\n' # print out completed sentence
        sentence = '' # Start new sentence as empty string.





    

