class Spicy::Disk::WordList
Public Class Methods
new(file_name)
click to toggle source
# File lib/disk-corpus.rb, line 24 def initialize(file_name) @file = File.open(file_name, 'rb') @cumulative = Spicy::Header.cumulative(@file) @min = @cumulative.keys.min @max = @cumulative.keys.max @origin = @file.pos end
Public Instance Methods
close()
click to toggle source
# File lib/disk-corpus.rb, line 32 def close @file.close end
word(*args)
click to toggle source
# File lib/disk-corpus.rb, line 36 def word(*args) seek(*args) do |index| @file.seek(@origin + index * @max, IO::SEEK_SET) @file.read(@max).strip end end