Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def train texts model = Hash.new(0) texts.each do |text| File.new(text).read.downcase.scan(/[a-z]+/).each do |word| model[word] += 1 end end return model end NWORDS = train ['holmes.txt','dictionaries/2of4brif.txt']
This paste will be private.
From the Design Piracy series on my blog: