updated README about fonts, added more app configurations and added the app.config file itself

This commit is contained in:
jenz
2023-06-28 22:46:52 +02:00
parent d5b9191521
commit dba5ebc3d1
5 changed files with 73 additions and 12 deletions
@@ -19,6 +19,9 @@ import edu.stanford.nlp.trees.*;
import edu.stanford.nlp.util.CoreMap;
import org.ejml.simple.SimpleMatrix;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.Matcher;
@@ -27,6 +30,8 @@ import java.util.regex.Pattern;
public class Datahandler {
//wanted to put this in config too but welp cant be arsed to set this up differently.
//4 threads for the rest of eternity it is.
private ExecutorService pool = Executors.newFixedThreadPool(4);
private CompletionService completionService = new ExecutorCompletionService(pool);
private HashMap<String, Annotation> pipelineAnnotationCache;
@@ -720,16 +725,30 @@ public class Datahandler {
} catch (InterruptedException e) {
//throw new RuntimeException(e);
pending = 0;
Properties prop = new Properties();
String fileName = "app.config";
try (FileInputStream fis = new FileInputStream(fileName)) {
prop.load(fis);
} catch (FileNotFoundException ex) {
} catch (IOException ex) {
}
System.out.printf(Arrays.toString(e.getStackTrace()));
pool.shutdown();
pool = Executors.newFixedThreadPool(4);
pool = Executors.newFixedThreadPool(Integer.valueOf(prop.getProperty("app.thread_count")));
completionService = new ExecutorCompletionService(pool);
} catch (ExecutionException e) {
//throw new RuntimeException(e);
pending = 0;
Properties prop = new Properties();
String fileName = "app.config";
try (FileInputStream fis = new FileInputStream(fileName)) {
prop.load(fis);
} catch (FileNotFoundException ex) {
} catch (IOException ex) {
}
System.out.printf(Arrays.toString(e.getStackTrace()));
pool.shutdown();
pool = Executors.newFixedThreadPool(4);
pool = Executors.newFixedThreadPool(Integer.valueOf(prop.getProperty("app.thread_count")));
completionService = new ExecutorCompletionService(pool);
}
}