Module: Core::Parser

Defined in:
lib/ruby-band/core/parser/parser.rb

Class Method Summary collapse

Class Method Details

.parse_ARFF(arff_file) ⇒ Object

Parse an ARFF file and create an Instances object



8
9
10
11
12
13
14
15
# File 'lib/ruby-band/core/parser/parser.rb', line 8

def Parser.parse_ARFF(arff_file)
  java_import 'java.io.File'
  loader = ArffLoader.new
  file = File.new arff_file 
  loader.setSource(file)
  data_instance = loader.getDataSet
  return data_instance
end

.parse_CSV(csv_file) ⇒ Object

Parse an CSV file and create an Instances object



18
19
20
21
22
23
24
25
# File 'lib/ruby-band/core/parser/parser.rb', line 18

def Parser.parse_CSV(csv_file) 
  java_import 'java.io.File'
  loader = CSVLoader.new
  file = File.new csv_file 
  loader.setSource(file)
  data_instance = loader.getDataSet
  return data_instance
end