Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions harmonizer/ast_semantic_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(self, vocabulary: Set[str]):
"run": "power",
"execute": "power",
"raise": "power",
"save": "power",
# JUSTICE (Order, Rules, Logic)
"assert": "justice",
"try": "justice",
Expand All @@ -71,6 +72,8 @@ def __init__(self, vocabulary: Set[str]):
"connect": "love",
"merge": "love",
"print": "love", # Communication is a form of Love
"user": "love",
"profile": "love",
}

self._node_map: Dict[ast.AST, str] = {}
Expand Down
16 changes: 0 additions & 16 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,6 @@ def test_execution_contextual_override(parser):
assert set(concepts) == expected_concepts


def test_execution_contextual_override(parser):
"""
Tests the contextual override for `_concepts_found.add`.
This should be mapped to 'wisdom', not 'community'.
"""
code = "self._concepts_found.add('new_concept')"
expected_concepts = {"wisdom"}

import ast

body = ast.parse(code).body
concepts = parser.get_execution_concepts(body)

assert set(concepts) == expected_concepts


def test_execution_method_call(parser):
"""Tests that a method call (e.g., db.query) is mapped correctly."""
code = "db.query('SELECT * FROM users')"
Expand Down
Loading