-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEval.java
More file actions
71 lines (66 loc) · 1.38 KB
/
Eval.java
File metadata and controls
71 lines (66 loc) · 1.38 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
import java.util.*;
import java.io.*;
class Eval
{
public void findeval(ArrayList<String> arrq)
{
int binrev[][] = Binv.bin;
double count[] = new double[50];
for(int i=0;i<binrev.length;i++)
{
for(int j=0;j<6;j++)
{
if(binrev[i][j]==1)
{
count[i]++;
}
}
count[i]=count[i]/6;
count[i] = ((double)Math.round(count[i]*100))/100;
//System.out.println(count[i]);
}
try
{
FileWriter writer = new FileWriter("eval1.txt");
BufferedWriter buffer = new BufferedWriter(writer);
buffer.write("Precision for every query\n");
for(int i=0;i<arrq.size();i++)
{
if(arrq.get(i).length()<=50)
{
buffer.write(arrq.get(i));
for(int j=0;j<50-arrq.get(i).length();j++)
{
//System.out.println("rthrtfyhsdrthdrh");
buffer.write(" ");
}
//for(int j=0;j<arrd.size();j++)
//{
buffer.write(" "+count[i]);
//}
buffer.write("\n");
}
else
{
buffer.write(arrq.get(i).substring(0,50));
for(int j=0;j<50-arrq.get(i).length();j++)
{
buffer.write(" ");
}
//for(int j=0;j<arrd.size();j++)
//{
buffer.write(" "+count[i]);
//}
buffer.write("\n");
buffer.write(arrq.get(i).substring(50));
buffer.write("\n");
}
}
buffer.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}