import codecs from math import log import re ingredient codecs . open ' i n g redientssecretsfrancitude . txt ', encoding ' utf 8 '. read . splitlines ingredient setx . encode ' utf 8 ' for x in ingredient def computescoretext filteredbodylower text . lower tokens filteredbodylower . split correctedscore 0 rawscore 0 streak False for token in tokens token re . sub '.!?,', '', token token re . sub '.!?,$', '', token . encode ' utf 8 ' if token in ingredient or re . sub '$', '', token in ingredient rawscore 1 if not streak correctedscore 1 streak True else streak False ratio rawscore floatlentokens if lentokens 0 else 0 if ratio 0 . 4 return 0 lengthbonus float 1 loglentext 1 return correctedscore lengthbonus <| sep |> Probabilmente non lo sanno neanche loro . Ai tempi , la ragione portata dal mio rappresentante di istituto in assemblea stata Non vogliamo fare un cazzo seguita da urli e vagine bagnate