[P-Reinforce] Global knowledge consolidation, massive deduplication (5,249 files), and high-density wikification (45 nodes)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
root_dir = "/Volumes/Data/project/Antigravity/Wiki"
|
||||
patterns = [
|
||||
re.compile(r"지식 요약 정보 추출 중"),
|
||||
re.compile(r"본문 구조화 작업 중")
|
||||
]
|
||||
|
||||
deleted_count = 0
|
||||
|
||||
for root, dirs, files in os.walk(root_dir):
|
||||
for file in files:
|
||||
if file.endswith(".md"):
|
||||
file_path = os.path.join(root, file)
|
||||
try:
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
if any(p.search(content) for p in patterns):
|
||||
os.remove(file_path)
|
||||
print(f"Deleted: {file_path}")
|
||||
deleted_count += 1
|
||||
except Exception as e:
|
||||
print(f"Error processing {file_path}: {e}")
|
||||
|
||||
print(f"\nTotal deleted: {deleted_count}")
|
||||
Reference in New Issue
Block a user