Sha256: 6f6ca37f7bab9e7d6d655746c470c4c79e9231c0185ed10245c01e2ad9f5dd42

Contents?: true

Size: 208 Bytes

Versions: 1

Compression:

Stored size: 208 Bytes

Contents

# frozen_string_literal: true

# Shingle a document
module Shingling
  def self.shingle(document, k)
    max_index = document.length - k + 1
    max_index.times.to_set { |i| document[i...(i + k)] }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doc_sim-0.1.1 lib/doc_sim/shingling.rb