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.



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

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

Instance Method Details

#bucketsObject



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

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