MCPcopy Create free account
hub / github.com/Bairong-Xdynamics/MistakeNotebookLearning / _fix_sqrt

Function _fix_sqrt

examples/utils/math_normalizer.py:79–91  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

77
78
79def _fix_sqrt(string):
80 if "\\sqrt" not in string:
81 return string
82 splits = string.split("\\sqrt")
83 new_string = splits[0]
84 for split in splits[1:]:
85 if split[0] != "{":
86 a = split[0]
87 new_substr = "\\sqrt{" + a + "}" + split[1:]
88 else:
89 new_substr = "\\sqrt" + split
90 new_string += new_substr
91 return new_string
92
93
94def _strip_string(string):

Callers 1

_strip_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected