MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / build_bootstrap_summary

Function build_bootstrap_summary

config/direction_lexicon.py:521–536  ·  view source on GitHub ↗

Build a reusable summary string from canonical directions.

(
    directions: Iterable[Any],
    *,
    lexicon: Optional[Dict[str, Any]] = None,
    prefer_chinese: bool = False,
    limit: int = 6,
)

Source from the content-addressed store, hash-verified

519
520
521def build_bootstrap_summary(
522 directions: Iterable[Any],
523 *,
524 lexicon: Optional[Dict[str, Any]] = None,
525 prefer_chinese: bool = False,
526 limit: int = 6,
527) -> str:
528 """Build a reusable summary string from canonical directions."""
529 labels = [
530 format_direction_label(direction, lexicon=lexicon, prefer_chinese=prefer_chinese)
531 for direction in directions
532 ]
533 deduped = _dedupe_strings(labels)
534 if not deduped:
535 return ""
536 return f"direction: {', '.join(deduped[: max(1, int(limit))])}"
537
538
539def _iter_match_terms(entry: Dict[str, Any], include_paper_terms: bool = True) -> Iterable[tuple[str, str]]:

Callers

nothing calls this directly

Calls 2

_dedupe_stringsFunction · 0.85
format_direction_labelFunction · 0.70

Tested by

no test coverage detected