Skip to content

Commit 1bef7a5

Browse files
authored
final project!!!
1 parent 233cef2 commit 1bef7a5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Definition.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void setTableList(String table) {
4141
public static List<Double> convertStringToList(String input) {
4242
List<Double> result = new ArrayList<>();
4343
// Split the input string on any number of whitespace characters
44-
String[] parts = input.split("\s+");
44+
String[] parts = input.split(" ");
4545

4646
for (String part : parts) {
4747
result.add(Double.parseDouble(part));

Parser.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ public class Parser {
55
public static String isQueryAlreadyExists(Network net,String queryVarName,ArrayList<String> queryAndEvidencesWithOutcome){
66
String ans = "-1";
77
for (int i = 0; i < net.getVarbyName(queryVarName).getCpt().length; i++) {
8-
ArrayList<String> row = new ArrayList<>(List.of(net.getVarbyName(queryVarName).getCpt()[i]));
8+
ArrayList<String> row = new ArrayList<>();
9+
for (String element : net.getVarbyName(queryVarName).getCpt()[i]){
10+
row.add(element);
11+
}
912
boolean first = row.subList(0,row.size()-1).containsAll(queryAndEvidencesWithOutcome);
1013
boolean second = queryAndEvidencesWithOutcome.containsAll(row.subList(0,row.size()-1));
1114
if(first&&second) {

0 commit comments

Comments
 (0)