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

fix issues with creating corpusfunction objects

parent 6b94d8a0
No related branches found
No related tags found
No related merge requests found
......@@ -76,11 +76,10 @@ class CorpusThread extends Thread {
// Indicator if we encountered the function
boolean found = false ;
for (String canonical : allFunctions) {
if (canonical.toLowerCase(Locale.ROOT).contains(function.toLowerCase(Locale.ROOT))) {
if (canonical.toLowerCase(Locale.ROOT).endsWith("." + function.toLowerCase(Locale.ROOT))) {
// Create an object from canonical name. calls the constructor with thr constructor setting hasfixingoption to false
try {
// functions.add((CorpusFunction) Class.forName(canonical).getDeclaredConstructor(boolean.class).newInstance(false));
functions.add((CorpusFunction) Class.forName(canonical).getDeclaredConstructor(Properties.class).newInstance());
functions.add((CorpusFunction) Class.forName(canonical).getDeclaredConstructor(Properties.class).newInstance(props));
found = true ;
}
catch (IllegalArgumentException | NoSuchMethodException | InstantiationException | InvocationTargetException | IllegalAccessException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment