Update app.py
Browse files
app.py
CHANGED
@@ -121,7 +121,8 @@ def check_language_issues(full_text: str) -> Dict[str, Any]:
|
|
121 |
"rule_id": match.ruleId,
|
122 |
"offset": match.offset,
|
123 |
"length": match.errorLength,
|
124 |
-
"coordinates":[]
|
|
|
125 |
})
|
126 |
print(f"Total language issues found: {len(issues)}")
|
127 |
return {
|
@@ -247,6 +248,7 @@ def highlight_issues_in_pdf(file, language_matches: List[Dict[str, Any]]) -> byt
|
|
247 |
final_x = target_words[len(target_words)-1][4]
|
248 |
final_y = target_words[len(target_words)-1][5]
|
249 |
issue["coordinates"] = [initial_x, initial_y, final_x, final_y]
|
|
|
250 |
# Add highlight annotations to the target words
|
251 |
for target in target_words:
|
252 |
page_num, word_text, x0, y0, x1, y1 = target
|
|
|
121 |
"rule_id": match.ruleId,
|
122 |
"offset": match.offset,
|
123 |
"length": match.errorLength,
|
124 |
+
"coordinates":[],
|
125 |
+
"page":0
|
126 |
})
|
127 |
print(f"Total language issues found: {len(issues)}")
|
128 |
return {
|
|
|
248 |
final_x = target_words[len(target_words)-1][4]
|
249 |
final_y = target_words[len(target_words)-1][5]
|
250 |
issue["coordinates"] = [initial_x, initial_y, final_x, final_y]
|
251 |
+
issue["page"] = target_words[0][0] + 1
|
252 |
# Add highlight annotations to the target words
|
253 |
for target in target_words:
|
254 |
page_num, word_text, x0, y0, x1, y1 = target
|