Module: BatchExperiment::UKP5Extractor
- Extended by:
- Extractor
- Defined in:
- lib/batch_experiment/sample_extractors.rb
Overview
Extractor for the output of the run_ukp5.out program available at github.com/henriquebecker91/masters. Not of interest for the majority of the users of this gem. Kept as example, and for this gem author personal use.
Class Method Summary collapse
-
.extract_from_lines(lines) ⇒ Array<String>
Optionally, you can define this method instead of #extract.
-
.names ⇒ Array<String>
Return the field names for each of the elements returned by extract.
Methods included from Extractor
extract, extract_from_lines, get_field, get_hfield, names
Class Method Details
.extract_from_lines(lines) ⇒ Array<String>
Optionally, you can define this method instead of #extract. The #extract method will call this method if not overrided.
40 41 42 43 44 |
# File 'lib/batch_experiment/sample_extractors.rb', line 40 def self.extract_from_lines(lines) ['Seconds', 'ext_time', 'ext_mem', 'opt'].map do | label | Extractor.get_field(lines, label) end end |
.names ⇒ Array<String>
Note:
To be on the safe side you should create a new array at each call. If you always return a reference to the same array the array can be modified.
Return the field names for each of the elements returned by extract. Ex.:
['Time', 'Max Mem Use', 'opt', ... ]
35 36 37 |
# File 'lib/batch_experiment/sample_extractors.rb', line 35 def self.names ['internal_time', 'external_time', 'external_memory', 'opt'] end |