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

Function is_draft_content

scripts/fetch_nmpa_fulltext.py:644–664  ·  view source on GitHub ↗

Detect if extracted text is a draft for comments (征求意见稿). Only official/final versions should be included in the knowledge base. Draft documents are identified by explicit markers in the first ~3000 chars.

(text: str)

Source from the content-addressed store, hash-verified

642
643
644def is_draft_content(text: str) -> bool:
645 """Detect if extracted text is a draft for comments (征求意见稿).
646
647 Only official/final versions should be included in the knowledge base.
648 Draft documents are identified by explicit markers in the first ~3000 chars.
649 """
650 if not text:
651 return False
652
653 head = text[:3000]
654
655 draft_patterns = [
656 r'征求意见稿',
657 r'征求\s*意见\s*稿',
658 ]
659
660 for pat in draft_patterns:
661 if re.search(pat, head):
662 return True
663
664 return False
665
666
667def validate_extracted_content(

Callers 5

mainFunction · 0.90
mainFunction · 0.90
rematch_unmatchedFunction · 0.85
download_and_extractFunction · 0.85

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected