123456789101112131415161718 |
- # example-2
- # Illustrates setting up and running an instance of uhferret in one block.
- require "uhferret"
- UHFerret::Ferret.new do
- # Add some documents to ferret and run calculations.
- add "text-eg/ruby.txt"
- add "text-eg/cobra.txt"
- add "text-eg/fantom.txt"
- run
- # Print the resemblance results formatted to 4 decimal places.
- each_pair do |i, j|
- puts "#{"%10s" % self[i].filename} #{"%10s" % self[j].filename} #{"%1.4f" % resemblance(i, j)}"
- end
- end
|