Skip to content

Commit

Permalink
Add handling of missing predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
mmxsrup committed Nov 14, 2023
1 parent 398b177 commit 83dc623
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions feature_extraction/methods/AuroraFE/src/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def check_predicates(ranking, oracle_preds_str):

res = []
for oracle_pred in oracle_preds:
found = False
for rank, ranking_pred in enumerate(ranking_preds):
# print(oracle_pred, ranking_pred)
cmp = oracle_pred.compare_to(ranking_pred)
Expand All @@ -63,11 +64,14 @@ def check_predicates(ranking, oracle_preds_str):
continue

# Found a exact or partial match predicate
found = True
if cmp == 0:
res.append(f"{oracle_pred}: Exact match at rank {rank}")
else:
res.append(f"{oracle_pred}: Partial match with rank {rank} and difference {cmp}")
break
if not found:
res.append(f"{oracle_pred}: Not found")
assert(len(res) == len(oracle_preds))

return res
Expand Down

0 comments on commit 83dc623

Please sign in to comment.