mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-13 05:09:03 +08:00
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)
This commit is contained in:
parent
39f1feaccb
commit
962c66714e
@ -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…
x
Reference in New Issue
Block a user