
de.gwdg.metadataqa.marc.analysis.ClassificationStatistics Maven / Gradle / Ivy
package de.gwdg.metadataqa.marc.analysis;
import de.gwdg.metadataqa.marc.cli.utils.Schema;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
public class ClassificationStatistics {
private Map instances = new HashMap<>();
private Map records = new HashMap<>();
private Map, Integer>> subfields = new HashMap<>();
private Map fieldInRecords = new HashMap<>();
private Map> fieldInstances = new TreeMap<>();
private Map hasClassifications = new HashMap<>();
private Map schemaHistogram = new HashMap<>();
private Map, Integer> collocationHistogram = new HashMap<>();
private Map frequencyExamples = new HashMap<>();
public ClassificationStatistics() {
}
public Map getInstances() {
return instances;
}
public Map getRecords() {
return records;
}
public Map, Integer>> getSubfields() {
return subfields;
}
public Map getFieldInRecords() {
return fieldInRecords;
}
public Map> getFieldInstances() {
return fieldInstances;
}
public Map getHasClassifications() {
return hasClassifications;
}
public Map getSchemaHistogram() {
return schemaHistogram;
}
public Map, Integer> getCollocationHistogram() {
return collocationHistogram;
}
public Integer recordCountWithClassification() {
if (collocationHistogram.isEmpty())
return Integer.valueOf(0);
return collocationHistogram
.entrySet()
.stream()
.map(Map.Entry::getValue)
.reduce((a, b) -> a + b)
.get();
}
public Map getFrequencyExamples() {
return frequencyExamples;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy