ncm_delta_parser
NCM Delta Parser: resolves compact delta strings to full NCM vectors.
- Parses the shorthand delta notation from reality_marble_recursion_index.yaml:
“KOR+0.4 D1-0.3 OXT-0.2 5HT1A-0.2 ENT1↑ ACC↑ SERT.reversed”
- Into a proper chemical vector dict:
{“KAPPA_OPIOID_KOR”: 0.4, “DOPAMINE_D1”: -0.3, …}
- ncm_delta_parser.resolve_node_name(abbrev)[source]
Resolve an abbreviation to its canonical NCM node name.
Falls back to the original string if no mapping exists (it may already be a full node name).
- ncm_delta_parser.parse_delta_string(delta_str)[source]
Parse a compact NCM delta string into a resolved chemical vector.
Examples:
>>> parse_delta_string("KOR+0.4 D1-0.3 OXT-0.2 ENT1↑ ACC↑") {'KAPPA_OPIOID_KOR': 0.4, 'DOPAMINE_D1': -0.3, 'OXYTOCIN_NEUROMIRROR': -0.2, 'ENT1_ACTIVITY': 0.15, 'ACC_SAL': 0.15} >>> parse_delta_string("SERT.reversed DAT.reversed") {'SERT_ACTIVITY': 0.2, 'DAT_ACTIVITY': 0.2}
- ncm_delta_parser.get_emotion_delta(emotion_name)[source]
Get the parsed NCM delta vector for a named emotion.
Returns an empty dict if the emotion is not found.
- ncm_delta_parser.scan_text_for_triggers(text, trigger_lexicon=None)[source]
Scan text for emotional trigger words and return matched deltas.