Skip to content
Snippets Groups Projects
Commit ba273481 authored by Lange, Dr. Herbert's avatar Lange, Dr. Herbert
Browse files

fix issues with changes of corpus services

parent f82867c3
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ class CorpusThread extends Thread { ...@@ -68,7 +68,7 @@ class CorpusThread extends Thread {
try { try {
// Create corpus from given input file/folder // Create corpus from given input file/folder
Corpus corpus = new Corpus(cio.read(new File(inFile).toURI().toURL())) ; Corpus corpus = new Corpus(cio.read(new File(inFile).toURI().toURL(),report)) ;
logger.info("Loaded " + corpus.getCorpusData().size() + " corpus files"); logger.info("Loaded " + corpus.getCorpusData().size() + " corpus files");
// For all functions to be applied, get their canonical name and create an object for them // For all functions to be applied, get their canonical name and create an object for them
Set<CorpusFunction> functions = new HashSet<>() ; Set<CorpusFunction> functions = new HashSet<>() ;
...@@ -123,7 +123,8 @@ class CorpusThread extends Thread { ...@@ -123,7 +123,8 @@ class CorpusThread extends Thread {
} }
// Generate HTML report // Generate HTML report
Collection<ReportItem> rawStatistics = report.getRawStatistics(); Collection<ReportItem> rawStatistics = report.getRawStatistics();
String reportOutput = ReportItem.generateDataTableHTML(rawStatistics, report.getSummaryLines()); String reportOutput = ReportItem.generateDataTableHTML(new ArrayList<>(rawStatistics),
report.getSummaryLines());
// Alternative: Generate XML // Alternative: Generate XML
//XStream xstream = new XStream(); //XStream xstream = new XStream();
//String reportOutput = xstream.toXML(rawStatistics); //String reportOutput = xstream.toXML(rawStatistics);
......
...@@ -7,7 +7,6 @@ import de.uni_hamburg.corpora.ReportItem; ...@@ -7,7 +7,6 @@ import de.uni_hamburg.corpora.ReportItem;
import org.reflections.Reflections; import org.reflections.Reflections;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
...@@ -15,8 +14,8 @@ import java.util.stream.Collectors; ...@@ -15,8 +14,8 @@ import java.util.stream.Collectors;
/** /**
* @author bba1792 Dr. Herbert Lange * @author bba1792 Dr. Herbert Lange
* @version 20210708 * @version 20220404
* Class encapsulating some of the corpus services functionality * Class encapsulating some corpus services functionality
*/ */
public class CorpusServices { public class CorpusServices {
/** /**
...@@ -29,7 +28,10 @@ public class CorpusServices { ...@@ -29,7 +28,10 @@ public class CorpusServices {
Reflections reflections = new Reflections("de.uni_hamburg.corpora"); Reflections reflections = new Reflections("de.uni_hamburg.corpora");
Set<Class<? extends CorpusFunction>> classes = reflections.getSubTypesOf(CorpusFunction.class); Set<Class<? extends CorpusFunction>> classes = reflections.getSubTypesOf(CorpusFunction.class);
// Convert classes to class names // Convert classes to class names
return classes.stream().filter((c) -> !Modifier.isAbstract(c.getModifiers())).map(Class::getCanonicalName).collect(Collectors.toSet()); return classes.stream()
.filter((c) -> Modifier.isPublic(c.getModifiers()) && !Modifier.isAbstract(c.getModifiers()))
.map(Class::getCanonicalName)
.collect(Collectors.toSet());
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment