MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / resolve_domain_subdir

Function resolve_domain_subdir

scripts/common.py:1517–1538  ·  view source on GitHub ↗
(
    config: dict[str, Any],
    *,
    title: str,
    abstract: str = "",
    subdir: str = "",
)

Source from the content-addressed store, hash-verified

1515
1516
1517def resolve_domain_subdir(
1518 config: dict[str, Any],
1519 *,
1520 title: str,
1521 abstract: str = "",
1522 subdir: str = "",
1523) -> str:
1524 if subdir.strip():
1525 return subdir.strip()
1526 label = infer_domain_label(title, abstract)
1527 existing = existing_domain_dirs(config)
1528 if existing:
1529 best_name = ""
1530 best_score = -1
1531 for domain_name in existing:
1532 score = domain_name_score(domain_name, label, title, abstract)
1533 if score > best_score:
1534 best_name = domain_name
1535 best_score = score
1536 if best_name and best_score > 0:
1537 return best_name
1538 return label
1539
1540
1541def resolve_obsidian_note_path(

Calls 3

infer_domain_labelFunction · 0.85
existing_domain_dirsFunction · 0.85
domain_name_scoreFunction · 0.85