Added some style modifications.
This commit is contained in:
@@ -76,15 +76,16 @@ public class Export {
|
||||
num_frequencies = Util.mapSumFrequencies(map);
|
||||
}
|
||||
|
||||
Map<String, Long> num_taxonomy_frequencies = new ConcurrentHashMap<>();
|
||||
for (String taxonomyKey : taxonomyResults.keySet()) {
|
||||
num_taxonomy_frequencies.put(taxonomyKey, (long) 0);
|
||||
for (AtomicLong value : taxonomyResults.get(taxonomyKey).values()){
|
||||
long val = num_taxonomy_frequencies.get(taxonomyKey);
|
||||
val += value.get();
|
||||
num_taxonomy_frequencies.put(taxonomyKey, val);
|
||||
}
|
||||
}
|
||||
// Map<String, Long> num_taxonomy_frequencies = new ConcurrentHashMap<>();
|
||||
// for (String taxonomyKey : taxonomyResults.keySet()) {
|
||||
// num_taxonomy_frequencies.put(taxonomyKey, (long) 0);
|
||||
// for (AtomicLong value : taxonomyResults.get(taxonomyKey).values()){
|
||||
// long val = num_taxonomy_frequencies.get(taxonomyKey);
|
||||
// val += value.get();
|
||||
// num_taxonomy_frequencies.put(taxonomyKey, val);
|
||||
// }
|
||||
// }
|
||||
Map<String, AtomicLong> num_taxonomy_frequencies = statistics.getUniGramOccurrences();
|
||||
|
||||
|
||||
//CSV file header
|
||||
@@ -105,7 +106,7 @@ public class Export {
|
||||
}
|
||||
}
|
||||
|
||||
headerInfoBlock.put(filter.getCalculateFor().toMetadataString(), String.valueOf(statistics.getUniGramOccurrences()));
|
||||
headerInfoBlock.put(filter.getCalculateFor().toMetadataString(), String.valueOf(statistics.getUniGramOccurrences().get("Total").longValue()));
|
||||
// headerInfoBlock.put(filter.getCalculateFor().toMetadataString(), String.valueOf(num_frequencies));
|
||||
|
||||
for (CalculateFor otherKey : filter.getMultipleKeys()) {
|
||||
@@ -127,7 +128,7 @@ public class Export {
|
||||
}
|
||||
|
||||
for (String key : taxonomyResults.keySet()) {
|
||||
if(!key.equals("Total") && num_taxonomy_frequencies.get(key) > 0) {
|
||||
if(!key.equals("Total") && num_taxonomy_frequencies.get(key).longValue() > 0) {
|
||||
FILE_HEADER_AL.add("Absolutna pogostost [" + key + "]");
|
||||
FILE_HEADER_AL.add("Delež [" + key + "]");
|
||||
FILE_HEADER_AL.add("Relativna pogostost [" + key + "]");
|
||||
@@ -270,13 +271,13 @@ public class Export {
|
||||
dataEntry.add(formatNumberAsPercent((double) e.getValue() / num_frequencies));
|
||||
dataEntry.add(String.format("%.2f", ((double) e.getValue() * 1000000)/num_frequencies));
|
||||
for (String key : taxonomyResults.keySet()){
|
||||
if(!key.equals("Total") && num_taxonomy_frequencies.get(key) > 0) {
|
||||
if(!key.equals("Total") && num_taxonomy_frequencies.get(key).longValue() > 0) {
|
||||
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() * 1000000) / num_taxonomy_frequencies.get(key)));
|
||||
dataEntry.add(formatNumberAsPercent((double) frequency.get() / statistics.getUniGramOccurrences()));
|
||||
dataEntry.add(String.format("%.2f", ((double) frequency.get() * 1000000) / statistics.getUniGramOccurrences()));
|
||||
dataEntry.add(formatNumberAsPercent((double) frequency.get() / num_taxonomy_frequencies.get(key).longValue()));
|
||||
dataEntry.add(String.format("%.2f", ((double) frequency.get() * 1000000) / num_taxonomy_frequencies.get(key).longValue()));
|
||||
// dataEntry.add(formatNumberAsPercent((double) frequency.get() / statistics.getUniGramOccurrences()));
|
||||
// dataEntry.add(String.format("%.2f", ((double) frequency.get() * 1000000) / statistics.getUniGramOccurrences()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user