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

Function enrich_document

worked/example/raw/processor.py:32–41  ·  view source on GitHub ↗

Add keyword index and cross-references to a validated document.

(doc: dict)

Source from the content-addressed store, hash-verified

30
31
32def enrich_document(doc: dict) -> dict:
33 """Add keyword index and cross-references to a validated document."""
34 text_blob = " ".join([
35 doc.get("title", ""),
36 " ".join(doc.get("sections", [])),
37 " ".join(doc.get("paragraphs", [])),
38 ])
39 doc["keywords"] = extract_keywords(text_blob)
40 doc["cross_refs"] = find_cross_references(doc)
41 return doc
42
43
44def find_cross_references(doc: dict) -> list:

Callers 1

process_and_saveFunction · 0.85

Calls 4

extract_keywordsFunction · 0.85
find_cross_referencesFunction · 0.85
joinMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected