Skip to content

Commit

Permalink
Update NeuraLogic with the latest updates
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasZahradnik committed Nov 15, 2022
1 parent 6bb7a1d commit c9f9e0a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions neuralogic/core/builder/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@ def _find_fact(self, fact_str):
if str(sample_fact.getClass().getSimpleName()) != "FactNeuron":
continue

if str(sample_fact.name).split(":")[-1].strip() == fact_str:
self.fact_cache[fact_str] = sample_fact
return sample_fact
name = str(sample_fact.name).strip()
space_index = name.rfind(" ")

while True:
if space_index == -1:
break

if name[space_index - 1] == ",":
space_index = name.rfind(" ", __end=space_index)
continue

if name[space_index + 1 :] == fact_str:
self.fact_cache[fact_str] = sample_fact
return sample_fact
break

return None

def get_fact(self, fact):
Expand Down
Binary file modified neuralogic/jar/NeuraLogic.jar
Binary file not shown.

0 comments on commit c9f9e0a

Please sign in to comment.