Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,13 +37,11 @@ def predict(input_text):
|
|
| 37 |
# assemble the array back to a string
|
| 38 |
pcnt_file_cr=' '.join(pcnt_file_array_hash).replace('#','\n')
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
pcnt_file_cr_cap =
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
return pcnt_file_cr_capi
|
| 47 |
|
| 48 |
if __name__ == "__main__":
|
| 49 |
|
|
|
|
| 37 |
# assemble the array back to a string
|
| 38 |
pcnt_file_cr=' '.join(pcnt_file_array_hash).replace('#','\n')
|
| 39 |
|
| 40 |
+
regex1 = r"\bi\b"
|
| 41 |
+
regex2 = r"(?<=[.?!]|\n)\s*\w"
|
| 42 |
+
pcnt_file_cr_cap = re.sub(regex2, lambda x: x.group().upper(), re.sub(regex1, "I", pcnt_file_cr))
|
| 43 |
|
| 44 |
+
return pcnt_file_cr_cap
|
|
|
|
|
|
|
| 45 |
|
| 46 |
if __name__ == "__main__":
|
| 47 |
|