Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ilarity-Index into Matthew
  • Loading branch information
MattReed-ZA committed Sep 28, 2022
2 parents edac833 + db957f8 commit f220835
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion server/services/tools.py
@@ -1,4 +1,5 @@
import json
from latex2sympy2 import latex2sympy
from datetime import datetime

#this function converts a json file to a txt file (replacing duplicate backslashes with single ones)
Expand Down Expand Up @@ -35,4 +36,14 @@ def get_date_time_type(dt: datetime):
"timezone": ""
}
# print(payload)
return payload
return payload

def detectCorruptLatex(latexIn):
try:
latex2sympy(latexIn)
#print("passed latex test! "+ latexIn)
return True
except:
print("corrupt latex detected:" + latexIn)
return False
return False

0 comments on commit f220835

Please sign in to comment.