Make the check that the Markov is not repeating existing sentence look at just letters (not punctuation)

This commit is contained in:
Jacob Harris
2013-07-23 14:41:31 -04:00
parent a66e59eb20
commit fe9caf4a43

View File

@@ -76,7 +76,8 @@ else
puts "MARKOV: #{tweet}"
end
break if !tweet.nil? && tweet.length < 110 && !source_tweets.any? {|t| t =~ /#{tweet}/ }
tweet_letters = tweet.gsub(/\W/, '')
break if !tweet.nil? && tweet.length < 110 && !source_tweets.any? {|t| t.gsub(/\W/, '') =~ /#{tweet_letters}/ }
end
if params["tweet"]