Sha256: 382f5125ed77e9e8c7efaa389ae4d6b8d467f991c5760fa5037751b13e8703a1

Contents?: true

Size: 197 Bytes

Versions: 1

Compression:

Stored size: 197 Bytes

Contents

# frozen_string_literal: true

module Shingling
  def self.shingle(document, k)
    max_index = document.length - k + 1
    max_index.times.map do |i|
      document[i...(i + k)]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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