Class: Hashira::Duplication::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/duplication/index.rb

Constant Summary collapse

RARE =
2
MAX_BUCKET =
60

Instance Method Summary collapse

Constructor Details

#initialize(fragments) ⇒ Index

Returns a new instance of Index.



7
8
9
10
# File 'lib/hashira/duplication/index.rb', line 7

def initialize(fragments)
  @fragments = fragments
  @frequency = frequencies(fragments)
end

Instance Method Details

#bucketsObject



12
# File 'lib/hashira/duplication/index.rb', line 12

def buckets = grouped.values.select { |bucket| bucket.size.between?(2, MAX_BUCKET) }