Refactored results - moved to taxonomyResults

This commit is contained in:
2018-07-05 09:37:35 +02:00
parent 8d7cce6c77
commit e2ce656fc5
8 changed files with 87 additions and 25 deletions

View File

@@ -108,9 +108,11 @@ public class Export {
}
FILE_HEADER_AL.add("Skupna relativna pogostost");
for (String key : taxonomyResults.keySet()) {
FILE_HEADER_AL.add("Absolutna pogostost [" + key + "]");
FILE_HEADER_AL.add("Delež [" + key + "]");
FILE_HEADER_AL.add("Relativna pogostost [" + key + "]");
if(!key.equals("Total")) {
FILE_HEADER_AL.add("Absolutna pogostost [" + key + "]");
FILE_HEADER_AL.add("Del [" + key + "]");
FILE_HEADER_AL.add("Relativna pogostost [" + key + "]");
}
}
FILE_HEADER = new String[ FILE_HEADER_AL.size() ];
FILE_HEADER_AL.toArray(FILE_HEADER);
@@ -160,11 +162,12 @@ public class Export {
dataEntry.add(formatNumberAsPercent((double) e.getValue() / num_frequencies));
dataEntry.add(String.format("%.2f", ((double) e.getValue() * 10000)/num_frequencies));
for (String key : taxonomyResults.keySet()){
AtomicLong frequency = taxonomyResults.get(key).get(e.getKey());
dataEntry.add(frequency.toString());
dataEntry.add(formatNumberAsPercent((double) frequency.get() / num_taxonomy_frequencies.get(key)));
dataEntry.add(String.format("%.2f", ((double) frequency.get() * 10000) / num_taxonomy_frequencies.get(key)));
if(!key.equals("Total")) {
AtomicLong frequency = taxonomyResults.get(key).get(e.getKey());
dataEntry.add(frequency.toString());
dataEntry.add(formatNumberAsPercent((double) frequency.get() / num_taxonomy_frequencies.get(key)));
dataEntry.add(String.format("%.2f", ((double) frequency.get() * 10000) / num_taxonomy_frequencies.get(key)));
}
}
csvFilePrinter.printRecord(dataEntry);