Commit 72b31b66 authored by ulrich's avatar ulrich

minor

parent fad5b922
......@@ -102,8 +102,6 @@ pub fn main() {
pub fn handle_document(path : String, corpus_path : String, annotation_path : String, config : &Config){
println!("Starting {}", path.clone());
let corpus = Corpus::new(path.clone());
let mut document = corpus.load_doc(path.clone()).unwrap();
......@@ -144,8 +142,6 @@ pub fn handle_document(path : String, corpus_path : String, annotation_path : St
// println!("Saving annotation at {}", save_location.clone());
create_kat_export(&save_location, &ambiguities, &config, file_name);
println!("thread finished {}", path);
}
......
......@@ -19,7 +19,7 @@ use libxml::tree::Document as DOM;
static KAT_QE : &'static str = "KAT_1_QuantityExpression";
pub static CORES : usize = 3;
pub static CORES : usize = 9;
/* Returns the content of the "annotation" child of a math node, which contains the tex-code */
pub fn get_tex_from_math(math_node : Node) -> String{
......
......@@ -2,15 +2,16 @@ from concurrent.futures import ThreadPoolExecutor
import sys
import os
executor = ThreadPoolExecutor(max_workers=2)
executor = ThreadPoolExecutor(max_workers=9)
if len(sys.argv) != 4:
print("usage: python3 start.py Documents Annotations Log")
if len(sys.argv) != 5:
print("usage: python3 start.py Documents Annotations Log Errorlog")
exit()
documents = sys.argv[1]
annotations = sys.argv[2]
log = sys.argv[3]
error_log = sys.argv[4]
if not os.path.isdir(documents):
print("argument " + documents + " is not a folder")
......@@ -21,10 +22,10 @@ if not os.path.isdir(annotations):
exit()
def my_fun(f):
command = "cargo run --release --bin scoring " + documents + "/" + f + " " + annotations + "/" + f + " >>" + log
command = "cargo run --release --bin scoring " + documents + "/" + f + " " + annotations + "/" + f + " >>" + log + " 2>>" + error_log
print(command)
os.system(command)
docs = os.listdir(documents)
executor.map(my_fun, docs)
executor.map(my_fun, docs, timeout=200)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment