Sha256: 04198dd6e89cce1d6c1a852e6b0669a19808ea27774590b78fdbbc51a99ea8b1
Contents?: true
Size: 398 Bytes
Versions: 9
Compression:
Stored size: 398 Bytes
Contents
module Lda class DataCorpus < Corpus attr_reader :filename def initialize(filename) super() @filename = filename load_from_file end protected def load_from_file txt = File.open(@filename, 'r') { |f| f.read } lines = txt.split(/[\r\n]+/) lines.each do |line| add_document(DataDocument.new(self, line)) end end end end
Version data entries
9 entries across 9 versions & 2 rubygems