<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -170,7 +170,7 @@ class Flay
       next unless node.any? { |sub| Sexp === sub }
       next if node.mass &lt; self.mass_threshold
 
-      self.hashes[node.fuzzy_hash] &lt;&lt; node
+      self.hashes[node.structural_hash] &lt;&lt; node
     end
   end
 
@@ -182,7 +182,7 @@ class Flay
     all_hashes = {}
     self.hashes.values.each do |nodes|
       nodes.each do |node|
-        node.all_subhashes.each do |h|
+        node.all_structural_subhashes.each do |h|
           all_hashes[h] = true
         end
       end
@@ -292,50 +292,14 @@ class String
 end
 
 class Sexp
-  def mass
-    @mass ||= self.structure.flatten.size
+  def structural_hash
+    @structural_hash ||= self.structure.hash
   end
 
-  alias :uncached_structure :structure
-  def structure
-    @structure ||= self.uncached_structure
-  end
-
-  def similarity o
-    l, s, r = self.compare_to o
-    (2.0 * s) / (2.0 * s + l + r)
-  end
-
-  def compare_to they
-    l = s = r = 0
-
-    l_sexp, l_lits = self.partition { |o| Sexp === o }
-    r_sexp, r_lits = they.partition { |o| Sexp === o }
-
-    l += (l_lits - r_lits).size
-    s += (l_lits &amp; r_lits).size
-    r += (r_lits - l_lits).size
-
-    # TODO: I think this is wrong, since it isn't positional. What to do?
-    l_sexp.zip(r_sexp).each do |l_sub, r_sub|
-      next unless l_sub &amp;&amp; r_sub # HACK
-      l2, s2, r2 = l_sub.compare_to r_sub
-      l += l2
-      s += s2
-      r += r2
-    end
-
-    return l, s, r
-  end
-
-  def fuzzy_hash
-    @fuzzy_hash ||= self.structure.hash
-  end
-
-  def all_subhashes
+  def all_structural_subhashes
     hashes = []
     self.deep_each do |node|
-      hashes &lt;&lt; node.fuzzy_hash
+      hashes &lt;&lt; node.structural_hash
     end
     hashes
   end
@@ -355,32 +319,3 @@ class Sexp
     end
   end
 end
-
-class Array
-  def intersection other
-    intersection, start = [], 0
-    other_size = other.length
-    self.each_with_index do |m, i|
-      (start...other_size).each do |j|
-        n = other.at j
-        if m == n then
-          intersection &lt;&lt; m
-          start = j + 1
-          break
-        end
-      end
-    end
-    intersection
-  end
-
-  def triangle # TODO: use?
-    max = self.size
-    (0...max).each do |i|
-      o1 = at(i)
-      (i+1...max).each do |j|
-        o2 = at(j)
-        yield o1, o2
-      end
-    end
-  end
-end</diff>
      <filename>lib/flay.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,8 @@
 require 'test/unit'
 require 'flay'
 
+$: &lt;&lt; &quot;../../sexp_processor/dev/lib&quot;
+
 require 'pp' # TODO: remove
 
 ON_1_9 = RUBY_VERSION =~ /1\.9/
@@ -28,36 +30,7 @@ class TestSexp &lt; Test::Unit::TestCase
            s(:call, nil, :d, s(:arglist)))
   end
 
-  def test_mass
-    assert_equal 1, s(:a).mass
-    assert_equal 3, s(:a, s(:b), s(:c)).mass
-    assert_equal 7, @s.mass
-  end
-
-  def test_compare_to
-    s1 = s(:a, :b, :c)
-    s2 = s(:d, :e, :f)
-    assert_equal [3, 0, 3], s1.compare_to(s2), &quot;100% different&quot;
-
-    s1 = s(:a, :b, :c)
-    s2 = s(:a, :b, :c)
-    assert_equal [0, 3, 0], s1.compare_to(s2), &quot;100% same&quot;
-
-    s1 = s(:a, :b, :c, :d)
-    s2 = s(:a, :b, :c, :e)
-    assert_equal [1, 3, 1], s1.compare_to(s2), &quot;1 element different on each&quot;
-
-    s1 = s(:a, :d, :b, :c)
-    s2 = s(:a, :b, :c, :e)
-    assert_equal [1, 3, 1], s1.compare_to(s2), &quot;positionally different&quot;
-
-
-    s1 = s(:a, s(:d), :b, :c)
-    s2 = s(:a, :b, :c, s(:e))
-    assert_equal [1, 3, 1], s1.compare_to(s2), &quot;simple subtree difference&quot;
-  end
-
-  def test_fuzzy_hash
+  def test_structural_hash
     s = s(:iter,
           s(:call, nil, :a, s(:arglist, s(:lit, 1))),
           s(:lasgn, :c),
@@ -65,22 +38,22 @@ class TestSexp &lt; Test::Unit::TestCase
 
     hash = 955256285
 
-    assert_equal hash, s.fuzzy_hash,             &quot;hand copy&quot;
-    assert_equal hash, @s.fuzzy_hash,            &quot;ivar from setup&quot;
-    assert_equal hash, @s.deep_clone.fuzzy_hash, &quot;deep clone&quot;
-    assert_equal hash, s.deep_clone.fuzzy_hash,  &quot;copy deep clone&quot;
+    assert_equal hash, s.structural_hash,             &quot;hand copy&quot;
+    assert_equal hash, @s.structural_hash,            &quot;ivar from setup&quot;
+    assert_equal hash, @s.deep_clone.structural_hash, &quot;deep clone&quot;
+    assert_equal hash, s.deep_clone.structural_hash,  &quot;copy deep clone&quot;
   end unless SKIP_1_9
 
-  def test_all_subhashes
+  def test_all_structural_subhashes
     expected = [-704571402, -282578980, -35395725,
                 160138040, 815971090, 927228382]
 
-    assert_equal expected, @s.all_subhashes.sort.uniq
+    assert_equal expected, @s.all_structural_subhashes.sort.uniq
 
     x = []
 
     @s.deep_each do |o|
-      x &lt;&lt; o.fuzzy_hash
+      x &lt;&lt; o.structural_hash
     end
 
     assert_equal expected, x.sort.uniq
@@ -146,12 +119,3 @@ class TestSexp &lt; Test::Unit::TestCase
     assert flay.hashes.empty?
   end
 end
-
-class ArrayIntersectionTests &lt; Test::Unit::TestCase
-  def test_real_array_intersection
-    assert_equal [2], [2, 2, 2, 3, 7, 13, 49] &amp; [2, 2, 2, 5, 11, 107]
-    assert_equal [2, 2, 2], [2, 2, 2, 3, 7, 13, 49].intersection([2, 2, 2, 5, 11, 107])
-    assert_equal ['a', 'c'], ['a', 'b', 'a', 'c'] &amp; ['a', 'c', 'a', 'd']
-    assert_equal ['a', 'a'], ['a', 'b', 'a', 'c'].intersection(['a', 'c', 'a', 'd'])
-  end
-end</diff>
      <filename>test/test_flay.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d02dcf1f2cd1f1f1aef2d02942ee5b358ad39467</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Davis</name>
    <email>ryand@zenspider.com</email>
  </author>
  <url>http://github.com/seattlerb/flay/commit/9b5e4c6765788c2f241f1c925bac4898110ba662</url>
  <id>9b5e4c6765788c2f241f1c925bac4898110ba662</id>
  <committed-date>2009-08-05T17:03:11-07:00</committed-date>
  <authored-date>2009-08-05T17:03:11-07:00</authored-date>
  <message>+ Renamed fuzzy_hash to structural_hash.
+ Renamed all_subhashes to all_structural_subhashes.
+ Pushed Sexp#mass up to sexp_processor.
+ Removed #similarity #compare_to, #intersection, #triangle, and other cruft.

[git-p4: depot-paths = &quot;//src/flay/dev/&quot;: change = 5361]</message>
  <tree>371219b15cd6869bb9b1c706e557cd179b6e019b</tree>
  <committer>
    <name>Ryan Davis</name>
    <email>ryand@zenspider.com</email>
  </committer>
</commit>
