-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.py
63 lines (62 loc) · 1.91 KB
/
helpers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
def find_math_words(text):
math_words = ''
if '\\int' in text:
math_words += ' integral'
if '\\lim' in text:
math_words += ' limit'
if '\\sum' in text:
math_words += ' sum'
if '\\infty' in text:
math_words += ' infinity'
if '{matrix}' in text or '{pmatrix}' in text or '{bmatrix}' in text:
math_words += ' matrix'
if '{array}' in text:
math_words += ' array'
if '\\exp' in text or 'e^' in text:
math_words += ' exponential'
if 'ln(' in text or 'log(' in text:
math_words += ' log'
if '\\sqrt' in text:
math_words += ' square root'
if '\\frac' in text:
math_words += ' fraction'
if '\\sin' in text:
math_words += ' sine'
if '\\cos' in text:
math_words += ' cosine'
if '\\tan' in text:
math_words += ' tangent'
if '\\arctan' in text:
math_words += ' arctangent'
if '\\pi' in text:
math_words += ' pi'
if '\\partial' in text:
math_words += ' partial'
if '\\Delta' in text:
math_words += ' delta'
if '\\geq' in text or '\\leq':
math_words += ' greater than'
if '\\cdot' in text:
math_words += ' cdot'
if '\\subset' in text or '\\subseteq' in text:
math_words += ' subset'
if ('\\cup' in text or '\\cap' in text
or '\\bigcup' in text or '\\bigcap' in text):
math_words += ' cup'
if '\\epsilon' in text or '\\varepsilon' in text:
math_words += ' epsilon'
if '\\inf' in text:
math_words += ' infimum'
if '\\sup' in text:
math_words += ' supremum'
if '\\min' in text:
math_words += ' minimum'
if '\\max' in text:
math_words += ' maximum'
if '\\det' in text:
math_words += ' determinant'
if '^T' in text:
math_words += ' transpose'
if '\\mod' in text:
math_words += ' modulo'
return math_words