trish06 commited on
Commit
5e0994d
·
verified ·
1 Parent(s): 72ca143

Update backend/main.py

Browse files
Files changed (1) hide show
  1. backend/main.py +3 -1
backend/main.py CHANGED
@@ -123,7 +123,7 @@ def extract_text_from_pdf(pdf_path: str) -> str:
123
  text, re.IGNORECASE | re.DOTALL | re.MULTILINE
124
  )
125
 
126
- if methods_match and len(methods_match.group(2).strip()) > 200:
127
  text = methods_match.group(1)
128
  else:
129
  chars = len(text)
@@ -133,6 +133,8 @@ def extract_text_from_pdf(pdf_path: str) -> str:
133
  if len(words) > 1500:
134
  text = " ".join(words[:1500])
135
 
 
 
136
  return text
137
 
138
 
 
123
  text, re.IGNORECASE | re.DOTALL | re.MULTILINE
124
  )
125
 
126
+ if methods_match and len(methods_match.group(1).strip()) > 200:
127
  text = methods_match.group(1)
128
  else:
129
  chars = len(text)
 
133
  if len(words) > 1500:
134
  text = " ".join(words[:1500])
135
 
136
+ text = text.replace("\n", " ")
137
+
138
  return text
139
 
140