Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def rateSentence():
global sentence
global finished_sentences
global max_rating
rating = ngram.rateSentence(sentence)
if rating[0] == max_rating:
addSentence(rating)
elif rating[0] > max_rating:
max_rating = rating[0]
finished_sentences = []
addSentence(rating)