Module: BatchExperiment::TwoWordsExtractor

Extended by:
Extractor
Defined in:
lib/batch_experiment/sample_extractors.rb

Class Method Summary collapse

Methods included from Extractor

extract, extract_from_lines, get_field, get_hfield, names

Class Method Details

.extract_from_lines(lines) ⇒ Object



41
42
43
44
45
46
# File 'lib/batch_experiment/sample_extractors.rb', line 41

def self.extract_from_lines(lines)
  words = lines.empty? || lines[0].nil? ? ['',''] : lines[0].split().take(2)
  words << Extractor.get_field(lines, 'ext_time')
  words << Extractor.get_field(lines, 'ext_mem')
  words
end

.namesObject



37
38
39
# File 'lib/batch_experiment/sample_extractors.rb', line 37

def self.names
  ['first word', 'second word', 'ext_time', 'ext_mem']
end