Bläddra i källkod

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 år sedan
förälder
incheckning
962c66714e
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1
    1
      deepdoc/parser/pdf_parser.py

+ 1
- 1
deepdoc/parser/pdf_parser.py Visa fil

@@ -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"]

Laddar…
Avbryt
Spara