Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
infovillasimius committed Aug 1, 2022
1 parent f109b42 commit 48d4479
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions amr2Fred/src/resultsComparator/Amr2File2.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ public static void main(String[] args) {
}

rdf1.add(amrS);
System.out.println("Sentence " + (counter + 1) + " out of " + amr.size());
if (counter % 50 == 0) {
System.out.println("Sentence " + (counter + 1) + " out of " + amr.size());
}
counter++;
}
doNewConvert(o, data);
Expand Down Expand Up @@ -220,24 +222,22 @@ private static void doNewConvert(File o, File data) {
dataWriter.append(rdf1.get(x)); //.replaceAll("\r\n|\r|\n", " ")
dataWriter.append("</s>");
dataWriter.newLine();

}
dataWriter.flush();
}

if (mode == 1) {
Comparator c;
BufferedWriter writer = new BufferedWriter(new FileWriter(result.getAbsolutePath()));
int dim = min(rdf1.size(), rdf2.size());
boolean flag = false;
for (int x = 0; x < dim; x++) {
c = new Comparator(rdf2.get(x), rdf1.get(x), false);
if (c.getFma() < 1 || c.getAmf() < 1) {
flag = true;
writer.append("Sentence " + (x + 1));

writer.newLine();
writer.newLine();
writer.append("previous \\ current = " + c.getFma() * 100 + "%");

writer.newLine();

for (Triple t : c.getfMinusA()) {
Expand All @@ -258,6 +258,10 @@ private static void doNewConvert(File o, File data) {
writer.newLine();
}
}
if (!flag) {
writer.append("No difference on " + dim + " sentences");
writer.newLine();
}
writer.flush();
}

Expand Down

0 comments on commit 48d4479

Please sign in to comment.