#!/usr/local/bin/ruby # test2.rb -- tests avl using the unique word test # by Filip Pizlo, 2001 # expected output: all words in the input document, sorted # use getwords and Dussel.txt for comparison require 'AVL' hash=AVL::AVL.new File.open(ARGV[0]).read.split(/[^a-zA-Z0-9]+/).each { | word | unless hash[word] hash[word]=true #puts word end } hash.each_key {|x| puts x }