Update app.py
Browse files
app.py
CHANGED
@@ -259,6 +259,10 @@ def highlight_issues_in_pdf(file, language_matches: List[Dict[str, Any]]) -> byt
|
|
259 |
|
260 |
# print(f"Concatenated text length: {concatenated_text} characters.")
|
261 |
|
|
|
|
|
|
|
|
|
262 |
# Find "References" section and exclude from processing
|
263 |
references_start = concatenated_text.lower().find("references")
|
264 |
references_offset = len(concatenated_text) if references_start == -1 else references_start
|
@@ -269,7 +273,7 @@ def highlight_issues_in_pdf(file, language_matches: List[Dict[str, Any]]) -> byt
|
|
269 |
length = issue["length"]
|
270 |
|
271 |
# Skip issues in the references section
|
272 |
-
if offset >= references_offset:
|
273 |
continue
|
274 |
|
275 |
|
|
|
259 |
|
260 |
# print(f"Concatenated text length: {concatenated_text} characters.")
|
261 |
|
262 |
+
# Find "Abstract" section and set the processing start point
|
263 |
+
abstract_start = concatenated_text.lower().find("abstract")
|
264 |
+
abstract_offset = 0 if abstract_start == -1 else abstract_start
|
265 |
+
|
266 |
# Find "References" section and exclude from processing
|
267 |
references_start = concatenated_text.lower().find("references")
|
268 |
references_offset = len(concatenated_text) if references_start == -1 else references_start
|
|
|
273 |
length = issue["length"]
|
274 |
|
275 |
# Skip issues in the references section
|
276 |
+
if offset < abstract_offset or offset >= references_offset:
|
277 |
continue
|
278 |
|
279 |
|