Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
reviews = [] reviews << "I had a different idea of this place. It was previously owned by Johnny Depp, so you expect cool people to be there. We had to pay 15 dollars to get in. Once there I was dissapointed to see how small and claustrophic the place was, specially the small lounge downstairs. I wanted to leave after my first minute there. A standard rock band was playing with an obnoxious attitude, they were cursing at each other and burping on the microphone during each song. The mum of one of the band members was giving free cds, wich made the whole thing uncool. I didnt take the free cds. Perhaps the place had its golden era in the nineties, but for me it seems to be over. Avoid it, unless you know a good band is playing that night lolz." reviews << "I HaD A diFF erent of this place. It was previously owned by Johnny Depp, so you expect cool people to be the RE. We had to pay 15 dollars to get in. Once there I was dissapointed to see how small and claustrophic the place was, specially the small lounge downstairs. I wanted to leave after my first minute there. A standard rock band playing with an obnoxious attitude, they were cursing at each other and burping on the microphone during each song. The mum of one of the band members was giving free , wich made the whole thing uncool. I didnt take the free cds. Perhaps the place had its golden era in the nineties, But for me it seems to be over. Avoid it, unless you know a good band is playing that night." reviews << "I visited the Viper Room a few months ago and hear the BEST band EVER-- 'Just Off Turner'-- I just found out their CD's can be purchased at cdbaby or probably at the Viper Room when they're playing. GREAT EXPERIENCE!" reviews << "Went with a friend who lives in W. Hollywood, so the walk to and from the Viper Room was an experience in itself. Of the hundreds and hundreds of clubs I've been in, I thought the Viper Room rated right up there. The wait was about an hour, and the doorman was quite entertaining. They had an excellent sound system upstairs. Johnny Mar (Mars?) was playing the night we went and, although it wasn't my type of music, I really enjoyed it. Then we went downstairs to the smaller, more intimate bar and the only disappointment, aside from Johnny not being there (!), was that the music was piped in and way too loud, I thought, so that even though you were in this intimate setting, you had to yell to be heard. The next day, I went through my wallet and pulled out a fake $20 that someone had passed me at the Viper, but that could have happened anywhere. All in all, it was a great experience and a fun night!" # in addition to line breaks and spaces, you probably want to remove *all* # symbols and punctuation other than commas from the strings reviews.collect! {|x| x.gsub(/\s/){}.gsub(/\n/){}.downcase} candidate_clauses = reviews[0].split(',') reviews.each_with_index do |review,i| clauses = review.split(',') size_before = clauses.size.to_f candidate_clauses.each do |candidate_clause| clauses.delete_if {|clause| clause.include?(candidate_clause)} end size_after = clauses.size.to_f congruity = ((size_before - size_after)/size_before*100).round p "#{i} - #{congruity}" end #$ ruby compare.rb #"0 - 100" #"1 - 43" #"2 - 0" #"3 - 0"
This paste will be private.
From the Design Piracy series on my blog: