class Spicy::Memory::WordList

Public Class Methods

new(file_name) click to toggle source
# File lib/memory-corpus.rb, line 24
def initialize(file_name)
  File.open(file_name, 'rb') do |r|
    @cumulative = Spicy::Header.cumulative(r)
    @min = @cumulative.keys.min
    @max = @cumulative.keys.max
    @words = r.read.split("\0")
  end
end

Public Instance Methods

word(*args) click to toggle source
# File lib/memory-corpus.rb, line 33
def word(*args)
  seek(*args) do |index|
    @words[index]
  end
end
words() click to toggle source
# File lib/memory-corpus.rb, line 39
def words
  @words
end