From e1b9f68ff7c16a9411add9beabcdbfa545d1679b Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 18 May 2022 14:15:12 +0300 Subject: add main file --- src/main.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main.rs (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..781ee2b --- /dev/null +++ b/src/main.rs @@ -0,0 +1,34 @@ +use std::env; +use correlation_rust::parser; +use correlation_rust::correlations; +fn main () { + + + let json_file = match env::args().nth(1){ + Some(tmp_file) => { + let results = parser::JsonData::new(&tmp_file); + + + let parsed_x_vals:Vec = results.x_vals.split(",").map(|f|f.trim().parse::().unwrap()).collect(); + + + + let computation = correlations::Compute::new( + ',', + "pearson", + &results.file_path, + &parsed_x_vals + + ).compute(); + + //println!("{:?}",computation); + + } + None => panic!("expected an arugment for the json file") + }; + + + + + +} \ No newline at end of file -- cgit 1.4.1