1+ import java .nio .file .Files ;
2+ import java .nio .file .Paths ;
3+
4+ import org .json .JSONObject ;
5+
16public class MMLMain {
27
38
@@ -12,13 +17,30 @@ public static void main(String[] args) throws Exception {
1217 // System.err.println(args[0]);
1318 // System.err.println(args[1]);
1419
15- TargetLanguage tl = TargetLanguage .PYTHON ; // TargetLanguage.R
20+ TargetLanguage tl = TargetLanguage .PYTHON ; // TargetLanguage.PYTHON; //
21+
22+
23+ //String str = Files.readString(Paths.get("mml.json"));
24+
25+ /*
26+ String str = "{ \"file_path\": \"iris.csv\", \"target\": 'variety' }";
27+ JSONObject obj = new JSONObject(str);
28+ String f = obj.getString("file_path");
29+ String t = obj.getString("target");
30+ ConfigurationML configuration = new ConfigurationML(f, t);
31+ */
32+
33+
34+ // TODO: instead of command line arguments, we will use JSON files to configure the compilers
35+ ConfigurationML configuration = new ConfigurationML (args [0 ], args [1 ]);
1636 MLExecutor ex = null ;
37+
38+
1739 if (tl == TargetLanguage .PYTHON ) {
18- ex = new PythonMLExecutor ();
40+ ex = new PythonMLExecutor (configuration );
1941 }
2042 else if (tl == TargetLanguage .R ) {
21- ex = new RLanguageMLExecutor ();
43+ ex = new RLanguageMLExecutor (configuration );
2244 }
2345
2446 else if (tl == TargetLanguage .JULIA ) {
@@ -32,8 +54,8 @@ else if (tl == TargetLanguage.JULIA) {
3254 // TODO
3355 }
3456
35- // TODO: instead of command line arguments, we will use JSON files to configure the compilers
36- ex .generateCode (args [ 0 ], args [ 1 ] );
57+
58+ ex .generateCode ();
3759 ex .run ();
3860
3961
0 commit comments