chore: mass removal of 1064 empty placeholder files in Topics
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
base_path = r'E:\Wiki\2nd\10_Wiki\Topics'
|
||||
empty_files = []
|
||||
|
||||
def is_empty_template(content):
|
||||
# Check if Summary section is basically empty
|
||||
summary_match = re.search(r'## 📌 한 줄 통찰 \(The Karpathy Summary\)\n>\s*\n', content)
|
||||
# Check if Content section is basically empty
|
||||
content_match = re.search(r'## 📖 구조화된 지식 \(Synthesized Content\)\s*## ⚠️ 모순', content, re.DOTALL)
|
||||
|
||||
if summary_match and content_match:
|
||||
return True
|
||||
return False
|
||||
|
||||
for root, dirs, files in os.walk(base_path):
|
||||
for f in files:
|
||||
if f.endswith('.md'):
|
||||
file_path = os.path.join(root, f)
|
||||
if len(file_path) > 240: continue
|
||||
|
||||
try:
|
||||
with open(file_path, 'r', encoding='utf-8', errors='ignore') as f_obj:
|
||||
content = f_obj.read()
|
||||
if is_empty_template(content):
|
||||
empty_files.append(file_path)
|
||||
except:
|
||||
pass
|
||||
|
||||
print(f"Found {len(empty_files)} empty template files.")
|
||||
for f in empty_files[:50]:
|
||||
print(f"{f}")
|
||||
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
|
||||
base_path = r'E:\Wiki\2nd\10_Wiki\Topics'
|
||||
junk_phrases = [
|
||||
"지식 요약 정보 추출 중...",
|
||||
"본문 구조화 작업 중...",
|
||||
"신규 문서로, 기존 정보와의 충돌 분석 예정."
|
||||
]
|
||||
|
||||
found_files = []
|
||||
|
||||
for root, dirs, files in os.walk(base_path):
|
||||
for f in files:
|
||||
if f.endswith('.md'):
|
||||
file_path = os.path.join(root, f)
|
||||
if len(file_path) > 240: continue
|
||||
|
||||
try:
|
||||
with open(file_path, 'r', encoding='utf-8', errors='ignore') as f_obj:
|
||||
content = f_obj.read()
|
||||
if any(phrase in content for phrase in junk_phrases):
|
||||
found_files.append(file_path)
|
||||
except:
|
||||
pass
|
||||
|
||||
print(f"Found {len(found_files)} in-progress placeholder files.")
|
||||
for f in found_files:
|
||||
print(f"{f}")
|
||||
Reference in New Issue
Block a user