MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / detect_subcategory

Method detect_subcategory

scripts/migrate_posts.py:125–132  ·  view source on GitHub ↗

Detect insights subcategory from post categories.

(self, post: dict)

Source from the content-addressed store, hash-verified

123 return ""
124
125 def detect_subcategory(self, post: dict) -> str:
126 """Detect insights subcategory from post categories."""
127 cat_ids = post.get("categories", [])
128 for cat_id in cat_ids:
129 slug = self.get_category_slug(cat_id)
130 if slug in CATEGORY_MAP:
131 return CATEGORY_MAP[slug]
132 return DEFAULT_SUBCATEGORY
133
134 def html_to_markdown(self, html: str) -> str:
135 if not html:

Callers 2

save_postMethod · 0.95
list_postsMethod · 0.95

Calls 2

get_category_slugMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected