Integrate the knowledge ASAP.
If we do this before the parsing we can leverage that semantics in the matching phase.
This commit is contained in:
parent
02f909269a
commit
2bfe676b2d
2 changed files with 17 additions and 5 deletions
|
@ -123,12 +123,17 @@ def pertenence_to_group(knowledge_base, elements, subj, group):
|
|||
if "groups" not in knowledge_base[subj]:
|
||||
knowledge_base[subj]["groups"] = set()
|
||||
|
||||
return modifiable_element_for_existance_in_set(
|
||||
container=knowledge_base[subj],
|
||||
set_name="groups",
|
||||
element=group
|
||||
)
|
||||
if group not in knowledge_base:
|
||||
knowledge_base[group] = {}
|
||||
|
||||
if "groups" not in knowledge_base[group]:
|
||||
knowledge_base[group]["groups"] = set()
|
||||
|
||||
return modifiable_element_for_existance_in_group(
|
||||
container=knowledge_base[subj],
|
||||
element=group,
|
||||
backlink=knowledge_base[group],
|
||||
)
|
||||
|
||||
def has_capacity(knowledge_base, elements, subj, capacity):
|
||||
subj = resolve(knowledge_base, elements, subj)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue