if File.exist? 
  @data = Marshal.load open()
else
  @data = {}
end



class String
  def index_sanitize
    self.split.collect do |token|
      token.downcase.gsub(/\W/, '')
    end
  end
end


ARGV.each do |filename|
  open filename do |file|
    file.read.index_sanitize.each do |word|
      @data[word] ||= []
      @data[word] << filename unless @data[word].include? filename
    end
  end
end

open(, ) do |index|
  index.write Marshal.dump(@data)
end