瀏覽代碼

fix divide by zero bug (#447)

### What problem does this PR solve?

#445 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.3.0
KevinHuSh 1 年之前
父節點
當前提交
962c66714e
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      deepdoc/parser/pdf_parser.py

+ 1
- 1
deepdoc/parser/pdf_parser.py 查看文件

@@ -64,7 +64,7 @@ class HuParser:
"""

def __char_width(self, c):
return (c["x1"] - c["x0"]) // len(c["text"])
return (c["x1"] - c["x0"]) // max(len(c["text"]), 1)

def __height(self, c):
return c["bottom"] - c["top"]

Loading…
取消
儲存