# Write a program that divides up some input text into sentences
# and then determines which sentence in the input has the most words.
# Print out the sentence with the most words and the number of words
# that are in it. Optionally, also print out all words in that
# sentence that are longer than 4 characters.
#
# Sentences can end in periods, exclamation points and question
# marks, but not colons or semi-colons.
#
# If you need something to input, try Shylock's famous speech from
# Shakespeare's The Merchant of Venice:
#


text = "If it will feed nothing else, it will feed my revenge. " \
       "He hath disgrac'd me and hind'red me half a million; " \
       "laugh'd at my losses, mock'd at my gains, scorned my nation, " \
       "thwarted my bargains, cooled my friends, heated mine enemies. " \
       "And what's his reason? I am a Jew. Hath not a Jew eyes? " \
       "Hath not a Jew hands, organs, dimensions, senses, affections, " \
       "passions, fed with the same food, hurt with the same weapons, " \
       "subject to the same diseases, healed by the same means, warmed " \
       "and cooled by the same winter and summer, as a Christian is? " \
       "If you prick us, do we not bleed? If you tickle us, do we not laugh? " \
       "If you poison us, do we not die? And if you wrong us, shall we not revenge? " \
       "If we are like you in the rest, we will resemble you in that. " \
       "If a Jew wrong a Christian, what is his humility? Revenge. " \
       "If a Christian wrong a Jew, what should his sufferance be by " \
       "Christian example! Why, revenge. The villainy you teach me I " \
       "will execute; and it shall go hard but I will better the instruction."


def sentence(in_text):
    # replace end of sentence punctuation '?' '!' with '.' to enable easy split()
    temp_text = in_text.replace("?", ".")
    temp_text = temp_text.replace("!", ".")
    temp_text = temp_text.split(".")
    temp_text = [x.strip() for x in temp_text]
    longest = ""
    for s in temp_text:
        if len(s) > len(longest):
            longest = s
    words = []
    for word in longest.replace(",", "").split():
        if len(word) > 4:
            words.append(word)
    return longest, len(longest.split()), words


print(sentence(text))
