mirror of
				https://github.com/qurator-spk/page2tsv.git
				synced 2025-11-04 10:34:14 +01:00 
			
		
		
		
	permit empty files
This commit is contained in:
		
							parent
							
								
									2dc3857770
								
							
						
					
					
						commit
						a834da494a
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		
							
								
								
									
										3
									
								
								cli.py
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								cli.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -284,6 +284,9 @@ def page2tsv(page_xml_file, tsv_out_file, image_url, ner_rest_endpoint, ned_rest
 | 
			
		|||
 | 
			
		||||
    tsv = pd.DataFrame(tsv, columns=['rid', 'line', 'hcenter'] + out_columns)
 | 
			
		||||
 | 
			
		||||
    if len(tsv)==0:
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
    vlinecenter = pd.DataFrame(tsv[['line', 'top']].groupby('line', sort=False).mean().top +
 | 
			
		||||
                               (tsv[['line', 'bottom']].groupby('line', sort=False).mean().bottom -
 | 
			
		||||
                                tsv[['line', 'top']].groupby('line', sort=False).mean().top) / 2,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue