Skip to content

Commit

Permalink
🔥 Drop support for compressed facts files
Browse files Browse the repository at this point in the history
Part of #37
  • Loading branch information
hayesall committed Jun 6, 2022
1 parent 508d31e commit 2cfd739
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/main/java/edu/wisc/cs/will/ILP/LearnOneClause.java
Original file line number Diff line number Diff line change
Expand Up @@ -1434,19 +1434,12 @@ private List<Sentence> readFacts(Reader factsReader, String readerDirectoryName,
}

private void addToFacts(String factsFileName) {
// TODO(@hayesall): Drop support for `.gz` files.
try {
boolean isCompressed = false;
if (!Utils.fileExists(factsFileName)) {
if (Utils.fileExists(factsFileName + ".gz")) {
factsFileName += ".gz";
isCompressed = true;
} else {
Utils.error("Cannot find this file (nor its GZIPPED version):\n " + factsFileName);
}
Utils.error("Cannot find this file:\n " + factsFileName);
}
File factsFile = Utils.ensureDirExists(factsFileName);
addToFacts(isCompressed ? new CondorFileReader(factsFileName) : new CondorFileReader(factsFile), factsFile.getParent()); // Need the String in CondorFileReader since that will check if compressed.
addToFacts(new CondorFileReader(factsFile), factsFile.getParent()); // Need the String in CondorFileReader since that will check if compressed.
} catch (IOException e) {
Utils.reportStackTrace(e);
Utils.error("Cannot find this file: " + factsFileName);
Expand Down

0 comments on commit 2cfd739

Please sign in to comment.