修正报错消息
This commit is contained in:
		
							parent
							
								
									c45fa88684
								
							
						
					
					
						commit
						28d777a96b
					
				@ -469,14 +469,16 @@ def read_and_clean_pdf_text(fp):
 | 
				
			|||||||
                    '- ', '') for t in text_areas['blocks'] if 'lines' in t]
 | 
					                    '- ', '') for t in text_areas['blocks'] if 'lines' in t]
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
        ############################## <第 2 步,获取正文主字体> ##################################
 | 
					        ############################## <第 2 步,获取正文主字体> ##################################
 | 
				
			||||||
        fsize_statiscs = {}
 | 
					        try:
 | 
				
			||||||
        for span in meta_span:
 | 
					            fsize_statiscs = {}
 | 
				
			||||||
            if span[1] not in fsize_statiscs: fsize_statiscs[span[1]] = 0
 | 
					            for span in meta_span:
 | 
				
			||||||
            fsize_statiscs[span[1]] += span[2]
 | 
					                if span[1] not in fsize_statiscs: fsize_statiscs[span[1]] = 0
 | 
				
			||||||
        main_fsize = max(fsize_statiscs, key=fsize_statiscs.get)
 | 
					                fsize_statiscs[span[1]] += span[2]
 | 
				
			||||||
        if REMOVE_FOOT_NOTE:
 | 
					            main_fsize = max(fsize_statiscs, key=fsize_statiscs.get)
 | 
				
			||||||
            give_up_fize_threshold = main_fsize * REMOVE_FOOT_FFSIZE_PERCENT
 | 
					            if REMOVE_FOOT_NOTE:
 | 
				
			||||||
 | 
					                give_up_fize_threshold = main_fsize * REMOVE_FOOT_FFSIZE_PERCENT
 | 
				
			||||||
 | 
					        except:
 | 
				
			||||||
 | 
					            raise RuntimeError(f'抱歉, 我们暂时无法解析此PDF文档: {fp}。')
 | 
				
			||||||
        ############################## <第 3 步,切分和重新整合> ##################################
 | 
					        ############################## <第 3 步,切分和重新整合> ##################################
 | 
				
			||||||
        mega_sec = []
 | 
					        mega_sec = []
 | 
				
			||||||
        sec = []
 | 
					        sec = []
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user