18/11/19: maintenance de la plate-forme - Interruptions du service gricad-gitlab et perturbations possibles tout au long de la journée.

Commit b314ad44 authored by Cyril Labbe's avatar Cyril Labbe

JavaDoc

	modified:   src/fr/imag/forge/Scidetect/Logger/Log.java
	modified:   src/fr/imag/forge/Scidetect/TextExtractor/Xmlextractor.java
	modified:   src/fr/imag/forge/Scidetect/TextExtractor/commandexecutor.java
	modified:   src/fr/imag/forge/Scidetect/TextExtractor/normalizer.java
	modified:   src/fr/imag/forge/Scidetect/TextExtractor/pdfextractor.java
parent 05431d34
......@@ -22,16 +22,31 @@ import java.io.PrintWriter;
import java.util.HashMap;
/**
*
* Manages the log files, where final results are written.
* @author Nguyen Minh Tien - minh-tien.nguyen@imag.fr
*/
public class Log {
/**
* The location of the log File
*/
public static String loglocation;
/**
* The location of the detail log file
*/
public static String detailloglocation;
// public static String testpath;
/**
* Time when the log was created
*/
public static String logtime;
/**
* Write in a log file all the computed distances.
*
* @param distant The distances set
*/
public void savedetaillog(HashMap<String, HashMap<String, Double>> distant) {
File distantout = new File(detailloglocation + logtime + ".xls");
......@@ -54,7 +69,9 @@ public class Log {
}
/**
* @param conclusion
* Write in a log file the classification decision
*
* @param conclusion contains the txt to be written in the log
*/
public void savelog(String conclusion) {
File distantout ;
......
......@@ -31,13 +31,17 @@ import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
/**
*
* Extract txt from a XML file
* @author Nguyen Minh Tien - minh-tien.nguyen@imag.fr
*/
public class Xmlextractor {
private String text = "";
/**
* <#Description#>
*
* @param nodeList <#nodeList description#>
*/
private void printNote(NodeList nodeList) {
for (int count = 0; count < nodeList.getLength(); count++) {
......@@ -57,7 +61,13 @@ public class Xmlextractor {
}
//return text;
}
/**
* <#Description#>
*
* @param xml <#xml description#>
*
* @return <#return value description#>
*/
public String xmlextract(File xml) throws IOException {
try {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
......
......@@ -21,10 +21,19 @@ import java.io.IOException;
import java.io.InputStreamReader;
/**
* commandexecutor executes a shell command
*
* @author Nguyen Minh Tien - minh-tien.nguyen@imag.fr
*/
public class commandexecutor {
/**
* Executes a shell command
*
* @param command the command to be executed
*
* @return "done" when the command has been executed !
*/
public static String execute(String command){
StringBuilder sb = new StringBuilder();
String[] commands = new String[]{"/bin/sh","-c", command};
......
......@@ -23,11 +23,20 @@ import java.io.IOException;
import java.io.PrintWriter;
/**
* Performs normalization and cleaning of a dirty text. For example to clean a text extracted from a pdf file.
*
* @author Nguyen Minh Tien - minh-tien.nguyen@imag.fr
*/
public class normalizer {
public class normalizer {
/**
* Perform a text cleaning and normalization: all the text is transform in upper case.
* non A to Z character are removed.
*
* @param txt the File to be cleaned and normalized the resulting text is overwrites the original text.
*
* @return contains all the normalized text.
*/
public String normalize(File txt) throws IOException {
BufferedReader br;
br = new BufferedReader(new FileReader(txt));
......
......@@ -26,11 +26,17 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.util.PDFTextStripper;
/**
*
* extract raw txt from a pdf File
* @author Nguyen Minh Tien - minh-tien.nguyen@imag.fr
*/
public class pdfextractor {
/**
* Extracts raw txt from a pdf file. The extracted txt is written in a File having the same name but with a .txt extension
*
* @param pdf a pdf File
*
* @return a string containing the extracted text.
*/
public String pdfextract(File pdf) throws IOException {
PDFTextStripper stripper = new PDFTextStripper();
......
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