-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreprocess.java
More file actions
72 lines (54 loc) · 1.52 KB
/
Preprocess.java
File metadata and controls
72 lines (54 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
60
61
62
63
64
65
66
67
68
69
70
71
72
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
public class Preprocess {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("usage: java Preprocess features_small_set features_big_set");
System.out.println("args[1] = " + args[0]);
System.out.println("args[2] = " + args[1]);
List<String> features_small = new ArrayList<String>();
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(args[0]));
String line = null;
while ((line = bufferedReader.readLine()) != null) {
features_small.add(line.trim());
}
} catch (Exception ex) {
ex.printStackTrace();
}
/*
for (String feature: features) {
System.out.println("feature: " + feature);
}
*/
List<String> features_big = new ArrayList<String>();
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(args[1]));
String line = null;
while ((line = bufferedReader.readLine()) != null) {
features_big.add(line.trim());
}
} catch (Exception ex) {
ex.printStackTrace();
}
int lineNo = 0;
int match = 0;
int mismatch = 0;
for (String feature : features_small) {
if (!features_big.contains(feature)) {
System.out.println("lineNo = " + lineNo + " feature = " + feature + " is not in");
mismatch++;
//System.exit(0);
}
else {
match++;
}
lineNo++;
}
System.out.println("match = " + match + "; mismatch = " + mismatch);
}
}