From 859b5bc2a04ed2061d23a9857bb6b9fa8aca0fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EA=B2=BD=EB=AF=BC?= Date: Thu, 19 Mar 2026 14:03:28 +0900 Subject: [PATCH] =?UTF-8?q?Cleanup:=20Deleting=2003.Code/=EC=97=85?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=EC=9A=A9/handlers/doc/custom=5Fdoc=5Ftype.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../업로드용/handlers/doc/custom_doc_type.py | 80 ------------------- 1 file changed, 80 deletions(-) delete mode 100644 03.Code/업로드용/handlers/doc/custom_doc_type.py diff --git a/03.Code/업로드용/handlers/doc/custom_doc_type.py b/03.Code/업로드용/handlers/doc/custom_doc_type.py deleted file mode 100644 index 03f6afb..0000000 --- a/03.Code/업로드용/handlers/doc/custom_doc_type.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Custom Doc Type Handler -- 사용자가 업로드한 HWPX를 분석하여 새로운 '문서 유형' 생성 -- Phase 1~3 전체 프로세스 오케스트레이션 -""" - -import os -import json -import time -from pathlib import Path - -# 도구들 -from .doc_type_analyzer import DocTypeAnalyzer -from ..template.doc_template_analyzer import DocTemplateAnalyzer -from ..template.semantic_mapper import SemanticMapper -from .content_analyzer import generate as generate_content_prompt - - -class CustomDocTypeHandler: - def __init__(self): - self.doc_analyzer = DocTypeAnalyzer() - self.temp_analyzer = DocTemplateAnalyzer() - self.semantic_mapper = SemanticMapper() - - def create_from_hwpx(self, file_path: str, doc_name: str, - description: str = "") -> dict: - """ - HWPX 파일을 분석하여 새로운 유저 문서 유형 생성 - """ - try: - # 1. HWPX 파싱 (구조/텍스트/XML 추출) - print(f"[Phase 1] Parsing HWPX: {file_path}") - parsed = self.doc_analyzer.parse(file_path) - - # 2. 문서 구조 분석 (디자인/레이아웃 추출) - print("[Phase 2] Analyzing Template Layout...") - template_info = self.temp_analyzer.analyze(parsed) - - # 3. 시맨틱 맵핑 (섹션 의미/역할 분석) - print("[Phase 3] Semantic Mapping...") - semantic_map = self.semantic_mapper.map_parsed(parsed) - - # 4. 콘텐츠 프롬프트 생성 (Placeholder 추출) - print("[Phase 4] Generating Content Prompt...") - content_prompt = generate_content_prompt( - template_info, semantic_map, parsed) - - # 5. 결과 조합 - result = { - "template_id": None, # 유저 커스텀은 ID 없음 - "layout": template_info, - "context": semantic_map.get("context", {}), - "structure": semantic_map.get("structure", {}), - "content_prompt": content_prompt - } - - # 6. 설정 파일 생성 - config = self.doc_analyzer._generate_config( - doc_name, description, result) - - # 7. 파일 시스템 저장 - # (이 부분은 실제 환경에 맞춰 조정 필요) - save_dir = self.doc_analyzer.save_doc_type( - config, template=None) - - return { - "success": True, - "doc_id": config["id"], - "save_path": save_dir, - "config": config - } - - except Exception as e: - import traceback - return { - "success": False, - "error": str(e), - "trace": traceback.format_exc() - }