Commit 247bdba1 authored by Javi Corvi's avatar Javi Corvi
Browse files

different folder for csv format

parent 83bfe25e
Pipeline #28871 passed with stage
in 2 minutes and 6 seconds
...@@ -127,6 +127,11 @@ public class App { ...@@ -127,6 +127,11 @@ public class App {
File outputDirectory = new File(outputFilePath); File outputDirectory = new File(outputFilePath);
if(!outputDirectory.exists()) if(!outputDirectory.exists())
outputDirectory.mkdirs(); outputDirectory.mkdirs();
String outputFilePathCSV = outputFilePath + File.separator + "csv_format";
File outputDirectoryCSV = new File(outputFilePathCSV);
if(!outputDirectoryCSV.exists())
outputDirectoryCSV.mkdirs();
Set<String> processedFiles = null; Set<String> processedFiles = null;
try { try {
...@@ -149,7 +154,7 @@ public class App { ...@@ -149,7 +154,7 @@ public class App {
} }
try { try {
process(inputFilePath, outputFilePath,workdirPath, annotationSet, annotationSetRelationExtraction, processedFiles); process(inputFilePath, outputFilePath, outputFilePathCSV, workdirPath, annotationSet, annotationSetRelationExtraction, processedFiles);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -160,7 +165,7 @@ public class App { ...@@ -160,7 +165,7 @@ public class App {
* @param properties_parameters_path * @param properties_parameters_path
* @throws IOException * @throws IOException
*/ */
public static void process(String inputDirectoryPath, String outputDirectoryPath, String workdir, String annotationSet, String annotationSetRelationExtraction, Set<String> processedFiles) throws IOException { public static void process(String inputDirectoryPath, String outputDirectoryPath, String outputDirectoryCSV, String workdir, String annotationSet, String annotationSetRelationExtraction, Set<String> processedFiles) throws IOException {
System.out.println("App::processTagger :: INIT "); System.out.println("App::processTagger :: INIT ");
if (java.nio.file.Files.isDirectory(Paths.get(inputDirectoryPath))) { if (java.nio.file.Files.isDirectory(Paths.get(inputDirectoryPath))) {
File inputDirectory = new File(inputDirectoryPath); File inputDirectory = new File(inputDirectoryPath);
...@@ -174,8 +179,8 @@ public class App { ...@@ -174,8 +179,8 @@ public class App {
String fileOutPutName = file.getName(); String fileOutPutName = file.getName();
File outputAbstractFile = new File (outputDirectoryPath + File.separator + fileOutPutName.replace(".xml", "_documents.json")); File outputAbstractFile = new File (outputDirectoryPath + File.separator + fileOutPutName.replace(".xml", "_documents.json"));
File outputAnnotationsFile = new File (outputDirectoryPath + File.separator + fileOutPutName.replace(".xml", "_annotations.json")); File outputAnnotationsFile = new File (outputDirectoryPath + File.separator + fileOutPutName.replace(".xml", "_annotations.json"));
File cvsFindingsOutputFile = new File (outputDirectoryPath + File.separator + fileOutPutName.replace(".xml", "_FINDINGS.csv")); File cvsFindingsOutputFile = new File (outputDirectoryCSV + File.separator + fileOutPutName.replace(".xml", "_FINDINGS.csv"));
File cvsSRDomainOutputFile = new File (outputDirectoryPath + File.separator + fileOutPutName.replace(".xml", "_SRDOMAIN.csv")); File cvsSRDomainOutputFile = new File (outputDirectoryCSV + File.separator + fileOutPutName.replace(".xml", "_SRDOMAIN.csv"));
processDocument(file, outputAbstractFile, outputAnnotationsFile, cvsFindingsOutputFile, cvsSRDomainOutputFile,annotationSet, annotationSetRelationExtraction); processDocument(file, outputAbstractFile, outputAnnotationsFile, cvsFindingsOutputFile, cvsSRDomainOutputFile,annotationSet, annotationSetRelationExtraction);
} catch (ResourceInstantiationException e) { } catch (ResourceInstantiationException e) {
System.out.println("App::process :: error with document " + file.getAbsolutePath()); System.out.println("App::process :: error with document " + file.getAbsolutePath());
......
Supports Markdown
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