Skip to content

Commit

Permalink
fixing and cleaning #25
Browse files Browse the repository at this point in the history
  • Loading branch information
omarrana committed Aug 29, 2017
1 parent 56d567f commit ad7c922
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,13 @@ public GoldStandard() {

}

/**
* Creating the GoldStandard based on the randomly generated files.
* Writes the elements in the GoldStandard text file by just repeating the corresponding
* element and adding a 1 at the end.
* @throws IOException
*/
public void addGoldStandard(String path) throws IOException {

ArrayList<String> duplicateCheck=new ArrayList<String>();
PrintWriter GoldStandard = new PrintWriter(
path + "PSL/test/GoldStandard.txt");



public LinkedHashSet<String> addGoldStandard(String path,String seed) throws IOException {
LinkedHashSet<String> goldStandardList = new LinkedHashSet<String>();
for (File file : files) {
if (file.getName().equals("seed.ttl")) {
if (file.getName().equals(seed)) {
InputStream inputStream = com.hp.hpl.jena.util.FileManager.get().open(file.getAbsolutePath());
Model model = null;
model = ModelFactory.createDefaultModel();
Expand Down Expand Up @@ -72,16 +65,36 @@ public void addGoldStandard(String path) throws IOException {
}
}

}
}
return goldStandardList;

}


/**
* Creating the GoldStandard based on the randomly generated files.
* Writes the elements in the GoldStandard text file by just repeating the corresponding
* element and adding a 1 at the end.
* @throws IOException
*/
public void addGoldStandard(String path) throws IOException {
ArrayList<String> duplicateCheck=new ArrayList<String>();
PrintWriter GoldStandard = new PrintWriter(
path + "PSL/test/GoldStandard.txt");
LinkedHashSet<String> goldStandardList = addGoldStandard(path,"seed.ttl");;
LinkedHashSet<String> seed1List = addGoldStandard(path,"plfile0.ttl");;
LinkedHashSet<String> seed2List = addGoldStandard(path,"plfile1.ttl");;


for (String val : goldStandardList) {
if(seed1List.contains(val)&& seed2List.contains(val))
if(!duplicateCheck.contains(val)){
duplicateCheck.add(val);
// remove annotation to make it a literal value
GoldStandard.println(val);
}
}
GoldStandard.close();
}
}
}

}
Loading

0 comments on commit ad7c922

Please sign in to comment.