-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubSet.java
More file actions
59 lines (44 loc) · 1.52 KB
/
subSet.java
File metadata and controls
59 lines (44 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import java.util.Scanner;
import java.io.*;
public class subSet{
public static void main(String[] args){
// File file = new File("/Users/evanaltshule/Documents/UCSB/spring19/cs48/Project/subset/formatTest.txt");
// ImgToString output = new ImgToString(file.getPath());
// output.format(output.getFilePathway());
// output.exportAs("~/Documents/UCSB/spring19/cs48/Project/subset/finalOutput.txt");
Format format = new Format();
String uf = "int main(){cout << \"Hello World \"; if(we do something here){ return something; }return 0; //a comment \n /* comment 1 \n comment 2 */}";
String f = new String();
f = format.formatText(uf);
System.out.println(f);
/*
PrintWriter outfile = null;
//unformattedCode = textdetectionAPI.detectText(filePathway);
try{
outfile = new PrintWriter("outfile.txt");
for(char ch: f.toCharArray()){
outfile.append(ch);
}
} catch (FileNotFoundException e){
System.out.println(e.toString());
} finally {
if (outfile != null){
outfile.close();
}
}
}
*/
/*
Scanner s = new Scanner(System.in);
System.out.println("Enter image file pathway. If file is in current directly, add \"./\" before your file name.");
String filePathway = new String(s.next());
System.out.print("File name: \"");
System.out.print(filePathway);
System.out.println("\"");
ImgToString test = new ImgToFormattedString(filePathway);
test.setOutputType(".java");
test.exportAs();
System.out.println("File output completed under outfile.java");
*/
}
}