python

スペル修正プログラムはどう書くかをrubyで書いてみる。*1 require 'set' class Correct def initialize (filename) File.open(filename) {|f| @nWords = train(words(f.read))} end def words (text) text.downcase.split(/\s|[,."]\s*/) end def train (fe…

なぜかpythonをさわる。http://www.python.jp/Zope/intro/instant_python_jpとかをみつつ。 インデントだけってのはキモくておもしろい。 if x < 5 or 10 < x < 20: print "The value is OK." とか地味にすごいと思った。あと、カプセル化について、http://w…