Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (12 sloc) 0.25 kB
class XRange
def initialize(n) @n=n end
def each() 0.upto(@n-1){|i|yield i} end
end
def xrange(n) XRange.new(n) end
def ngram(n, terms)
array = []
for i in xrange(terms.length - n + 1)
array << terms[i..i+n-1]
end
return array
end
Jump to Line
Something went wrong with that request. Please try again.