Skip to content

Commit

Permalink
Fixing issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasdugue committed Feb 11, 2016
1 parent 02b8de3 commit af66fdb
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/fr/ericlab/mabed/structure/Corpus.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class Corpus {
public int[] distribution;
public String output;


// Indexes
short[][] frequencyMatrix;
public ArrayList<String> vocabulary;
Expand All @@ -70,6 +71,10 @@ public class Corpus {
public Corpus(Configuration conf){
configuration = conf;
}

// Fixing Issue#4
private int a;
private int b;

public void prepareCorpus(){
System.out.println(Util.getDate()+" Preparing corpus...");
Expand All @@ -87,7 +92,9 @@ public void prepareCorpus(){
}
}
}
int a = Collections.min(list), b = Collections.max(list);
//Fixing Issue #4
this.a = Collections.min(list);
this.b = Collections.max(list);

//If Mabed is continuously used, getPeriod returns the number of files to take into account in the processing.
if (Configuration.getPeriod() != -1) {
Expand Down Expand Up @@ -156,7 +163,10 @@ public void loadCorpus(boolean parallelized){
}
}
}
int a = Collections.min(list), b = Collections.max(list);

//Fixing Issue #4
this.a = Collections.min(list);
this.b = Collections.max(list);
//If Mabed is continuously used, getPeriod returns the number of files to take into account in the processing.
if (Configuration.getPeriod() != -1) {
if ((nbTimeSlices % Configuration.getPeriod()) != 0)
Expand Down Expand Up @@ -246,7 +256,8 @@ public String getMessages(Event event){
NumberFormat formatter = FileNameFormatter.getFormatter();
String mainTerm = event.mainTerm;
int count = 0;
for(int i = event.I.timeSliceA; i <= event.I.timeSliceB; i++){
//Fixing Issue #4
for(int i = event.I.timeSliceA + this.a; i <= event.I.timeSliceB + this.a; i++){
try {
String filename = Configuration.getPath()+"/"+formatter.format(i)+".text";
List<String> lines = FileUtils.readLines(new File(filename));
Expand Down

0 comments on commit af66fdb

Please sign in to comment.