dschandra commited on
Commit
d4a05e1
·
verified ·
1 Parent(s): 62e4c88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -35,6 +35,10 @@ def parse_po_items_with_filters(text):
35
  """
36
  Parses purchase order items from the extracted text using regex with filters.
37
  Ensures items are not merged and handles split descriptions across lines.
 
 
 
 
38
  """
39
  lines = text.splitlines()
40
  data = []
@@ -106,7 +110,7 @@ def parse_po_items_with_filters(text):
106
  # Remove the extracted portion from item 2's description
107
  row["Description"] = row["Description"].replace(item_3_description.group(), "").strip()
108
 
109
- # Clean specific patterns from item 7
110
  for item in data:
111
  if item["Item"] == "7":
112
  # Remove unwanted text from description
 
35
  """
36
  Parses purchase order items from the extracted text using regex with filters.
37
  Ensures items are not merged and handles split descriptions across lines.
38
+ Args:
39
+ text (str): Extracted text from the PDF.
40
+ Returns:
41
+ tuple: A DataFrame with parsed data and a status message.
42
  """
43
  lines = text.splitlines()
44
  data = []
 
110
  # Remove the extracted portion from item 2's description
111
  row["Description"] = row["Description"].replace(item_3_description.group(), "").strip()
112
 
113
+ # Ensure each description's additional data is handled properly
114
  for item in data:
115
  if item["Item"] == "7":
116
  # Remove unwanted text from description