Commit d4ad73b4 authored by Cyril Labbe's avatar Cyril Labbe

Javadoc / unix makefile and manifest

parent f4acfdaf
......@@ -8,6 +8,7 @@ JAVAC = javac
JAVADOC = javadoc -d doc
JAVAFLAGS = -O -d classes -encoding utf-8
JAVACLASSPATH = -cp lib/pdfbox-app-1.8.8.jar
SRC = src/fr/imag/forge/scidetect/Checker/Utils/*.java src/fr/imag/forge/scidetect/Checker/*.java src/fr/imag/forge/scidetect/Corpus/*.java src/fr/imag/forge/scidetect/Logger/*.java src/fr/imag/forge/scidetect/SciDetect_local/*.java src/fr/imag/forge/scidetect/TextExtractor/*.java
default: all
......@@ -15,10 +16,10 @@ all: classes doc jar run
classes:
mkdir -p classes
$(JAVAC) $(JAVAFLAGS) $(JAVACLASSPATH) src/fr/imag/forge/scidetect/*/*.java
$(JAVAC) $(JAVAFLAGS) $(JAVACLASSPATH) $(SRC)
doc:
$(JAVADOC) src/*/*/*/*/*/*
$(JAVADOC) $(SRC)
jar:
cd classes ; jar -cfvm ../SciDetect_Local`date +%Y-%m-%d`.jar ../manifest.mf *; cd ..
......
Manifest-Version: 1.0
Class-Path: lib/pdfbox-app-1.8.8.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: fr.imag.forge.Scidetect.scigenchecker_local.ScigenChecker_Local
Main-Class: fr.imag.forge.scidetect.SciDetect_local.SciDetect_Local
......@@ -37,7 +37,7 @@ public class Classifier {
private ThresholdsSet SetOfThresholds;
/**
*
* Build a new classifier, thresholds are read in the configuration file
*/
public Classifier() {
this.SetOfThresholds = new ThresholdsSet();
......@@ -86,10 +86,10 @@ public class Classifier {
*
* @param result a string composed having for each classes the value of its
* NN
* @return
* @return a string composed of the classes and the distances to the nearest neighbor in each class.
*/
private String checkdistant(String result) {
String conclution = "";
String conclusion = "";
String[] eachtype = result.split("\n");
for (int i = 0; i < eachtype.length; i++) {
......@@ -105,16 +105,16 @@ public class Classifier {
}
//check distant with threshold
if (Double.parseDouble(eachNN[1]) < threshold[0]) {
conclution += "is a " + eachNN[0] + "\t" + eachNN[1] + "\t" + eachNN[2] + "\n";
conclusion += "is a " + eachNN[0] + "\t" + eachNN[1] + "\t" + eachNN[2] + "\n";
} else if (Double.parseDouble(eachNN[1]) < threshold[1]) {
conclution += "is suppected " + eachNN[0] + "\t" + eachNN[1] + "\t" + eachNN[2] + "\n";
conclusion += "is suppected " + eachNN[0] + "\t" + eachNN[1] + "\t" + eachNN[2] + "\n";
}
}
if (conclution == "") {
conclution = findmindistant(result);
if (conclusion == "") {
conclusion = findmindistant(result);
}
return conclution;
return conclusion;
}
/**
......
......@@ -24,7 +24,7 @@ import fr.imag.forge.scidetect.Checker.Utils.DistancesSet;
import fr.imag.forge.scidetect.Corpus.Corpus;
/**
*
* Compute distances between two sets of texts
* @author Nguyen Minh Tien - minh-tien.nguyen@imag.fr
*/
public class DistantCalculator {
......@@ -33,10 +33,10 @@ public class DistantCalculator {
private DistancesSet distant = new DistancesSet();
/**
*calculate the distant between 2 text corpus
* Compute distances between each text of a corpus and the samples
* @param samples corpus
* @param tests corpus
* @return DistancesSet from test to sample
* @return DistancesSet distances from text in test to text in sample
*/
public DistancesSet caldistant(Corpus samples, Corpus tests) {
for (String key : tests.keySet()) {
......@@ -53,9 +53,13 @@ public class DistantCalculator {
return distant;
}
/**
*Calculate distant between 2 text index
*/
/**
* Compute the distance between 2 texts index
* @param text1
* @param text2
* @return the distance between text 1 and text 2.
*/
private double cal_textdistant(HashMap<String, Integer> text1,
HashMap<String, Integer> text2) {
double nboftoken = 0.0;
......
......@@ -22,7 +22,7 @@ import java.io.PrintWriter;
import java.util.HashMap;
/**
*
* Index texts (i.e. for each word computes its occurrence number
* @author Nguyen Minh Tien - minh-tien.nguyen@imag.fr
*/
public class Indexer {
......@@ -30,8 +30,8 @@ public class Indexer {
private Object content;
/**
* Index a text (count how many time each word appeared)
* and write to file under then name INDEX-filename.txt
* Index a text (count how many time each word is appearing)
* and writes results in a file INDEX-filename.txt
* @param content
* @param textfile
* @throws FileNotFoundException
......
/*
* Copyright (C) 2015 UNIVERSITE JOSEPH FOURIER (Grenoble 1)/ Springer-Verlag GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.imag.forge.scidetect.Checker.Utils;
import java.util.HashMap;
......@@ -18,8 +34,8 @@ public class DistancesSet extends HashMap<String, HashMap<String, Double>>{
/**
* Get the value of the distance between A and B
* @param A
* @param B
* @param A text
* @param B text
* @return the distance between A and B
*/
public Double getDist(String A, String B){
......@@ -28,9 +44,9 @@ public class DistancesSet extends HashMap<String, HashMap<String, Double>>{
/**
* Set the distance between A and B to the value d
* @param A
* @param B
* @param d
* @param A text
* @param B text
* @param d distance
*/
public void setDist(String A, String B, Double d){
if (this.get(A) == null) {this.put(A,new HashMap<String, Double>());}
......
/*
* Copyright (C) 2015 UNIVERSITE JOSEPH FOURIER (Grenoble 1)/ Springer-Verlag GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.imag.forge.scidetect.Checker.Utils;
......@@ -18,8 +34,6 @@ public class ThresholdsSet extends HashMap<String, Double[]> {
/**
* Initialize the thresholds Set by reading the configuration file
* @throws FileNotFoundException
* @throws IOException
*/
public void Init() {
try{
......
......@@ -27,7 +27,7 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.util.PDFTextStripper;
/**
* extract raw txt from a pdf File
* Extract raw txt from a pdf File
* @author Nguyen Minh Tien - minh-tien.nguyen@imag.fr
*/
public class pdfextractor {
......
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