docs: 添加涉密文件自检工具实施计划

This commit is contained in:
2026-06-08 13:53:24 +08:00
commit 31161d9a5f
1838 changed files with 455407 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
# 忽略区域
from .tbpu import Tbpu
class IgnoreArea(Tbpu):
def __init__(self, areaList):
self.tbpuName = "忽略区域"
self.areaList = areaList
def run(self, textBlocks):
# 返回是否矩形框 a 包含 b
def isInBox(a, b):
return (
a[0][0] <= b[0][0]
and a[0][1] <= b[0][1]
and a[2][0] >= b[2][0]
and a[2][1] >= b[2][1]
)
newList = []
for b in textBlocks:
flag = True # True 为没有被忽略
# 检测当前文块 b 是否在任何一个检测块 a 内
for a in self.areaList:
if isInBox(a, b["box"]):
flag = False # 踩到任何一个块GG
break
if flag: # 没有被忽略
newList.append(b)
return newList