diff --git a/hwp_conversion.log b/hwp_conversion.log index 99835f2..a910285 100644 --- a/hwp_conversion.log +++ b/hwp_conversion.log @@ -12915,3 +12915,14 @@ 2025-03-04 17:58:43,243 - INFO - 변환 성공: 워드(한글)-011941-심진아.hwp -> 워드(한글)-011941-심진아.hml 2025-03-04 17:58:43,615 - INFO - 변환 성공: 워드(한글)-011942-이범.hwp -> 워드(한글)-011942-이범.hml 2025-03-04 17:58:43,980 - INFO - 변환 성공: 워드(한글)-012018-송현우.hwp -> 워드(한글)-012018-송현우.hml +2025-03-18 16:06:36,574 - INFO - 변환 성공: 워드(한글)-001191-조아현.hwp -> 워드(한글)-001191-조아현.hml +2025-03-18 16:07:22,539 - INFO - 변환 성공: 워드(한글)-001191-조아현.hwp -> 워드(한글)-001191-조아현.hml +2025-03-18 16:11:42,156 - INFO - 변환 성공: 워드(한글)-001191-조아현 copy.hwp -> 워드(한글)-001191-조아현 copy.hml +2025-03-18 16:16:56,532 - INFO - 변환 성공: 워드(한글)-001191-조아현 copy.hwp -> 워드(한글)-001191-조아현 copy.hml +2025-03-18 16:16:56,562 - INFO - 변환 성공: 워드(한글)-002623-유하균.hwp -> 워드(한글)-002623-유하균.hml +2025-03-18 16:16:56,668 - INFO - 변환 성공: 워드(한글)-004933-이상진.hwp -> 워드(한글)-004933-이상진.hml +2025-03-18 16:46:30,897 - INFO - 변환 성공: 워드(한글)-004574-김소윤.hwp -> 워드(한글)-004574-김소윤.hml +2025-03-18 16:54:36,213 - INFO - 변환 성공: 워드(한글)-001191-조아현.hwp -> 워드(한글)-001191-조아현.hml +2025-03-18 16:54:36,253 - INFO - 변환 성공: 워드(한글)-002623-유하균.hwp -> 워드(한글)-002623-유하균.hml +2025-03-18 16:54:36,355 - INFO - 변환 성공: 워드(한글)-004933-이상진.hwp -> 워드(한글)-004933-이상진.hml +2025-03-25 14:30:44,791 - INFO - 변환 성공: DIW_2503A.hwpx -> DIW_2503A.hml diff --git a/score5.py b/score5.py index 10b7607..272bb4f 100644 --- a/score5.py +++ b/score5.py @@ -349,6 +349,7 @@ class XMLScorer: # 차이점을 정리하여 result_diff에 저장 result_diff = [] + # 감점을 위한 누락 된 단어만 따로 리스트로 저장 missing_list = [] @@ -530,36 +531,36 @@ class XMLScorer: def main(): # scoring_criteria_path = r'./DIW.json' - # scoring_criteria_path = r'./DIW_2502A.json' + scoring_criteria_path = r'./DIW_2502A.json' # scoring_criteria_path = r'./DIW_2502B.json' # scoring_criteria_path = r'./DIW_2502C.json' # scoring_criteria_path = r'./DIW_2502D.json' - scoring_criteria_path = r'./DIW_2502E.json' + # scoring_criteria_path = r'./DIW_2502E.json' # xml(hml)파일 디렉토리 경로 # xml_directory = r'./output' - # xml_directory = r'./output/A' - # xml_directory = r'./output/B' - # xml_directory = r'./output/C' - # xml_directory = r'./output/D' - xml_directory = r'./output/E' + xml_directory = r'./output/A/DIW' + # xml_directory = r'./output/B/DIW' + # xml_directory = r'./output/C/DIW' + # xml_directory = r'./output/D/DIW' + # xml_directory = r'./output/E/DIW' # 오탈자 체크를 위한 정답 파일 경로 # answer_path = r'./output/정답.hml' - # answer_path = r'./output/A/DIW_2502A.hml' - # answer_path = r'./output/B/DIW_2502B.hml' - # answer_path = r'./output/C/DIW_2502C.hml' - # answer_path = r'./output/D/DIW_2502D.hml' - answer_path = r'./output/E/DIW_2502E.hml' + answer_path = r'./output/A/DIW/DIW_2502A.hml' + # answer_path = r'./output/B/DIW/DIW_2502B.hml' + # answer_path = r'./output/C/DIW/DIW_2502C.hml' + # answer_path = r'./output/D/DIW/DIW_2502D.hml' + # answer_path = r'./output/E/DIW/DIW_2502E.hml' timestamp = datetime.now().strftime("%y%m%d") # 엑셀 파일명 (비어있으면 자동생성) - # output_path = f"{timestamp}_DIW_2502A_채점결과.xlsx" + output_path = f"{timestamp}_DIW_2502A_채점결과.xlsx" # output_path = f"{timestamp}_DIW_2502B_채점결과.xlsx" # output_path = f"{timestamp}_DIW_2502C_채점결과.xlsx" # output_path = f"{timestamp}_DIW_2502D_채점결과.xlsx" - output_path = f"{timestamp}_DIW_2502E_채점결과.xlsx" + # output_path = f"{timestamp}_DIW_2502E_채점결과.xlsx" # 채점 클래스 초기화 scorer = XMLScorer(scoring_criteria_path) diff --git a/test.py b/test.py index 58ca1b1..b57aaec 100644 --- a/test.py +++ b/test.py @@ -64,14 +64,17 @@ def convert_hwp_to_xml(input_folder, output_folder): # HWP 파일 검색 및 변환 input_path = Path(input_folder) - for hwp_file in input_path.glob("*.hwp"): + for hwp_file in input_path.glob("*.hwpx") | input_path.glob("*.hwp"): try: # 파일 열기 - hwp.Open(str(hwp_file), "HWP") + if hwp_file.suffix == ".hwpx": + hwp.Open(str(hwp_file), "HWPX") + elif hwp_file.suffix == ".hwp": + hwp.Open(str(hwp_file), "HWP") #hwpactionid 기반 hwp.Run("MoveDocBegin") - hwp.Run("SelectCtrlFront") + hwp.Run("SelectCtrlFront") while True: curr = hwp.KeyIndicator() @@ -129,11 +132,11 @@ if __name__ == "__main__": # 변환할 폴더 경로 설정 folders = [ - # (r"C:\Users\dra\project\HWP\HWP-Scoring\input\A\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\A"), - # (r"C:\Users\dra\project\HWP\HWP-Scoring\input\B\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\B"), - # (r"C:\Users\dra\project\HWP\HWP-Scoring\input\C\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\C"), - # (r"C:\Users\dra\project\HWP\HWP-Scoring\input\D\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\D"), - (r"C:\Users\dra\project\HWP\HWP-Scoring\input\E\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\e_test") + (r"C:\Users\dra\project\HWP\HWP-Scoring\input\A\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\A\DIW"), + # (r"C:\Users\dra\project\HWP\HWP-Scoring\input\B\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\B\DIW"), + # (r"C:\Users\dra\project\HWP\HWP-Scoring\input\C\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\C\DIW"), + # (r"C:\Users\dra\project\HWP\HWP-Scoring\input\D\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\D\DIW"), + # (r"C:\Users\dra\project\HWP\HWP-Scoring\input\E\DIW",r"C:\Users\dra\project\HWP\HWP-Scoring\output\E\DIW"), ] # 변환 실행 diff --git a/zzz.xbook b/zzz.xbook index 7a2d5e1..396c52a 100644 --- a/zzz.xbook +++ b/zzz.xbook @@ -1 +1 @@ -[{"kind":2,"language":"xpath","value":"//FONTFACE[@Lang='Hangul']/FONT[@Id=//CHARSHAPE[@Id=//CHAR[contains(text(),'{searchValue}')]/parent::TEXT/@CharShape]/FONTID/@Hangul]/@Name"},{"kind":2,"language":"xpath","value":"//CHAR[contains(text(),'생산가능인구')]/following-sibling::FOOTNOTE"},{"kind":2,"language":"xpath","value":"/following-sibling::FOOTNOTE/descendant::CHAR[contains(text(),'전체 인구가 늘더라도 생산가능인구가 감소한다면 생산가능인구가 짊어져야 하는 비용은 증가한다.')]"},{"kind":2,"language":"xpath","value":"boolean(//CHAR[substring(., string-length(.) - string-length('생산가능인구') + 1) = '생산가능인구']/following-sibling::FOOTNOTE/descendant::CHAR[contains(text(),'전체 인구가 늘더라도 생산가능인구가 감소한다면 생산가능인구가 짊어져야 하는 비용은 증가한다')])"},{"kind":2,"language":"xpath","value":"//CHAR[substring(., string-length(.) - string-length('생산가능인구') + 1) = '생산가능인구']"},{"kind":2,"language":"xpath","value":"boolean(//CHAR[contains(text(),'생산가능인구')]/ancestor::TEXT/FOOTNOTE/descendant::CHAR[contains(text(),'전체 인구가 늘더라도 생산가능인구가 감소한다면 생산가능인구가 짊어져야 하는 비용은 증가한다')])"},{"kind":2,"language":"xpath","value":"boolean(//CHAR[contains(text(),'생산가능인구')]/following-sibling::FOOTNOTE/descendant::CHAR[contains(text(),'전체 인구가 늘더라도 생산가능인구가 감소한다면 생산가능인구가 짊어져야 하는 비용은 증가한다')])"},{"kind":2,"language":"xpath","value":"boolean(//CHAR[contains(text(),'생산가능인구')]/ancestor::TEXT/FOOTNOTE/descendant::CHAR[contains(normalize-space(text()),'전체 인구가 늘더라도 생산가능인구가 감소한다면 생산가능인구가 짊어져야 하는 비용은 증가한다')])"},{"kind":2,"language":"xpath","value":"//CHAR[contains(text(),'생산가능인구')]/ancestor::TEXT/FOOTNOTE/descendant::CHAR/translate(text(), ' ',' ')"}] \ No newline at end of file +[{"kind":2,"language":"xpath","value":"//RECTANGLE//CHAR[text()='인구절벽']/ancestor::RECTANGLE/descendant::LINESHAPE/@Style"}] \ No newline at end of file