pdftext 0.3.3__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pdftext
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Extract structured text from pdfs quickly
5
5
  Home-page: https://github.com/VikParuchuri/pdftext
6
6
  License: Apache-2.0
@@ -133,7 +133,7 @@ def infer_single_page(text_chars, block_threshold=settings.BLOCK_THRESHOLD):
133
133
  span = update_span(line, span)
134
134
  line = update_line(block, line)
135
135
  block = update_block(blocks, block)
136
- elif prev_char["char"] in LINE_BREAKS and prediction_probs[1] >= .5: # Look for newline character as a forcing signal for a new line
136
+ elif prev_char["char"] in LINE_BREAKS: # Look for newline character as a forcing signal for a new line
137
137
  span = update_span(line, span)
138
138
  line = update_line(block, line)
139
139
  elif prev_font_info != font_info:
@@ -42,8 +42,7 @@ def get_fontname(textpage, char_index):
42
42
  # Re-interpret the type from char to unsigned short as required by the function
43
43
  buffer_ptr = ctypes.cast(buffer, ctypes.POINTER(ctypes.c_ushort))
44
44
  flag_buffer = ctypes.c_int()
45
- flag_ptr = ctypes.pointer(flag_buffer)
46
- font_info = pdfium_c.FPDFText_GetFontInfo(textpage, char_index, buffer_ptr, n_bytes, flag_ptr)
45
+ font_info = pdfium_c.FPDFText_GetFontInfo(textpage, char_index, buffer_ptr, n_bytes, flag_buffer)
47
46
  if font_info == 0:
48
47
  return None, None
49
48
  try:
@@ -8,7 +8,6 @@ class Settings(BaseSettings):
8
8
  MODEL_PATH: str = os.path.join(BASE_PATH, "models", "dt.joblib")
9
9
 
10
10
  # Fonts
11
- FONT_BUFFER_SIZE: int = 1024 # How many characters to buffer when reading a font name
12
11
  FONTNAME_SAMPLE_FREQ: int = 10
13
12
 
14
13
  # Inference
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pdftext"
3
- version = "0.3.3"
3
+ version = "0.3.4"
4
4
  description = "Extract structured text from pdfs quickly"
5
5
  authors = ["Vik Paruchuri <vik.paruchuri@gmail.com>"]
6
6
  license = "Apache-2.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes