MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _node_rationale_text

Function _node_rationale_text

graphify/serve.py:706–717  ·  view source on GitHub ↗

The node's `rationale` attribute normalized like a label (diacritics folded, lower-cased) for substring matching. Semantic cleanup writes it as one string (several sources joined with blank lines); an extractor may hand over a list — join it. Missing or empty -> "" so callers can `if rat

(data: dict)

Source from the content-addressed store, hash-verified

704
705
706def _node_rationale_text(data: dict) -> str:
707 """The node's `rationale` attribute normalized like a label (diacritics
708 folded, lower-cased) for substring matching. Semantic cleanup writes it as
709 one string (several sources joined with blank lines); an extractor may hand
710 over a list — join it. Missing or empty -> "" so callers can `if rationale`.
711 """
712 raw = data.get("rationale")
713 if not raw:
714 return ""
715 if isinstance(raw, (list, tuple)):
716 raw = " ".join(str(part) for part in raw if part)
717 return _strip_diacritics(str(raw)).lower()
718
719
720def _node_search_text(data: dict, nid: str) -> str:

Callers 2

_node_fieldsFunction · 0.85
_node_search_textFunction · 0.85

Calls 3

_strip_diacriticsFunction · 0.70
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected