Skip to content

Commit

Permalink
Multiple textual sources, references by spottingMethod enum
Browse files Browse the repository at this point in the history
  • Loading branch information
gadelrab committed May 11, 2019
1 parent 6f5da10 commit a4fb188
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package checker;

import config.Configuration;
import de.mpii.factspotting.FactSpotterFactory;
import extendedsldnf.EvaluatorFactory;
import extendedsldnf.RecSLDEvaluator;
import extendedsldnf.datastructure.IExtendedFacts;
Expand Down Expand Up @@ -171,7 +172,16 @@ public IQueryExplanations check(InputQuery query,Collection<IRule> specificRules
}

private List<ITextConnector> getUsedTextualResources(List<TextualSource> textualSources) {
return Arrays.asList(new FactSpottingConnector(config));
List<ITextConnector> connectors=new ArrayList<>();

if(textualSources.isEmpty()){
connectors.add(new FactSpottingConnector(FactSpotterFactory.SpottingMethod.NONE,config));
}
else
{
textualSources.forEach(ts-> connectors.add(new FactSpottingConnector(FactSpotterFactory.SpottingMethod.valueOf(ts.getSourceName().toUpperCase()),config)));
}
return connectors;
}
//
// @Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,22 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(sourceName);
}


public String getSourceName() {
return sourceName;
}

public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}

public Double getWeight() {
return weight;
}

public void setWeight(Double weight) {
this.weight = weight;
}
}

0 comments on commit a4fb188

Please sign in to comment.