Class: Hashira::Duplication::Index
- Inherits:
-
Object
- Object
- Hashira::Duplication::Index
- Defined in:
- lib/hashira/duplication/index.rb
Constant Summary collapse
- RARE =
2- MAX_BUCKET =
60
Instance Method Summary collapse
- #buckets ⇒ Object
-
#initialize(fragments) ⇒ Index
constructor
A new instance of Index.
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
#buckets ⇒ Object
14 |
# File 'lib/hashira/duplication/index.rb', line 14 def buckets = grouped.values.select { |bucket| bucket.size.between?(2, MAX_BUCKET) } |