-
Notifications
You must be signed in to change notification settings - Fork 0
/
pronounciations.el
97 lines (95 loc) · 7.28 KB
/
pronounciations.el
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
(emacspeak-pronounce-set-dictionary 'text-mode
'((" -[0-9]+\\.?[0-9]+%?" re-search-forward . #[257 "\300\301\302\"P\207" [" minus " substring 2] 5 "(fn NUMBER)"])
("tau " . "tao ")))
(emacspeak-pronounce-set-dictionary 'comint-mode
'(("[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}" re-search-forward . emacspeak-pronounce-uuid) ("[0-9a-f]\\{40\\}" re-search-forward . emacspeak-pronounce-sha-checksum)))
(emacspeak-pronounce-set-dictionary 'conf-space-mode
'(("[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}" re-search-forward . emacspeak-pronounce-uuid)))
(emacspeak-pronounce-set-dictionary 'conf-unix-mode
'(("[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}" re-search-forward . emacspeak-pronounce-uuid)))
(emacspeak-pronounce-set-dictionary 'conf-mode
'(("[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}" re-search-forward . emacspeak-pronounce-uuid)))
(emacspeak-pronounce-set-dictionary 'xml-mode
'(("http://search.yahoo.com/mrss/" . "media") ("http://purl.org/dc/elements/1.1/" . "DC") ("http://www.w3.org/1999/xhtml" . " xhtml ") ("http://www.w3.org/2001/XMLSchema" . " XSD ") ("http://www.w3.org/2001/XMLSchema-instance" . " XSI ") ("http://www.w3.org/2001/vxml" . " vxml ") ("http://www.w3.org/2001/xml-events" . " XEvents ") ("http://www.w3.org/2002/xforms" . " XForms ") ("http://www.w3.org/1999/XSL/Transform" . " XSLT ") ("http://www.w3.org/2003/XInclude" . "XInclude") ("http://www.w3.org/2002/06/xhtml2" . " xhtml2 ") ("http://www.w3.org/1999/02/22-rdf-syntax-ns#" . "RDF Syntax") ("http://www.w3.org/2005/Atom" . " atom ")))
(emacspeak-pronounce-set-dictionary 'magit-mode
'(("[0-9a-f]\\{40\\}" re-search-forward . emacspeak-pronounce-sha-checksum)))
(emacspeak-pronounce-set-dictionary 'eww-mode
'(("[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}T[0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\(\\.[0-9]\\{3\\}\\)?\\([zZ]\\|\\([+-][0-9]\\{2\\}:[0-9]\\{2\\}\\)\\)" re-search-forward . emacspeak-speak-decode-rfc-3339-datetime) ("http://search.yahoo.com/mrss/" . "media") ("http://purl.org/dc/elements/1.1/" . "DC") ("http://www.w3.org/1999/xhtml" . " xhtml ") ("http://www.w3.org/2001/XMLSchema" . " XSD ") ("http://www.w3.org/2001/XMLSchema-instance" . " XSI ") ("http://www.w3.org/2001/vxml" . " vxml ") ("http://www.w3.org/2001/xml-events" . " XEvents ") ("http://www.w3.org/2002/xforms" . " XForms ") ("http://www.w3.org/1999/XSL/Transform" . " XSLT ") ("http://www.w3.org/2003/XInclude" . "XInclude") ("http://www.w3.org/2002/06/xhtml2" . " xhtml2 ") ("http://www.w3.org/1999/02/22-rdf-syntax-ns#" . "RDF Syntax") ("http://www.w3.org/2005/Atom" . " atom ")))
(emacspeak-pronounce-set-dictionary 'latex-mode
'(("^" . " caret ")))
(defun emacspeak-pronounce-latex-integral (str)
(let* ((prefix (concat " integral from "))
(range (substring str 4))
(first-bracket (s-prefix? "{" range))
(last-bracket (s-suffix? "}" range)))
(concat prefix
(if first-bracket (substring range 1 4)
(substring range 0 1))
" to "
(if last-bracket (substring range -4 -1)
(substring range -1))
" ")))
(emacspeak-pronounce-set-dictionary 'org-mode
'(("pardiffdiff{[a-zA-Z_0-9\s\\\\]+}{[a-zA-Z0-9_\s\\\\]+}{[2]+}" re-search-forward . (lambda (str) (concat " partial squared " (s-join " over partial " (split-string (substring str 12 (- (length str) 4)) "}{")) " squared ")))
("-[A-Z0-9\\]" re-search-forward . (lambda (str) (replace-regexp-in-string "-" " minus " str)))
("\\equiv" . "\\equivalent")
("\\nabla\\cdot" . " divergence ")
("\\nabla\\times" . " curl ")
("\\nabla" . " gradient ")
("\\begin{array}" . " start array ")
("\\end{array}" . " end array ")
("\\\\[mh]box{[a-zA-Z0-9$_\s]+}" re-search-forward . (lambda (str) (concat " " (substring str 6 -1) " ")))
("\\iiint" . " triple \\int")
("\\iint" . " double \\int")
("\\oint" . " closed \\int")
("{\\delta}" . " Dirac delta ")
("\\int_\\([a-zA-Z0-9]\\|\\({[a-zA-Z0-9]_[a-zA-Z0-9]}\\)\\)\\^\\([a-zA-Z0-9]\\|\\({[a-zA-Z0-9]_[a-zA-Z0-9]}\\)\\)" re-search-forward . emacspeak-pronounce-latex-integral)
("[a-z]([a-zA-Z])" re-search-forward . (lambda(str) (concat (substring str 0 1) " of " (substring str 2 -1) " ")))
("\\int_" . " \\int over ")
("\\int " . " integral ")
("_{i=1}^n" . " from i=1 to n ")
("{\\\\bf\s[a-zA-Z]}" re-search-forward . (lambda (str) (concat " " (substring str 5 6) " ")))
("{[0-9]+}" re-search-forward . (lambda (str) (concat " " (substring str 1 -1) " ")))
("{-x}" . " negative x ")
("\\xi" . " ksee ")
("\\frac{1}{2}" . " 1half ")
("^3" . " cubed ")
("{minus1/2}" . " negative 1half ")
("minus1/2" . " minus 1half ")
("{1/2}" . " 1half ")
("1/2" . " 1half ")
("[A-Z0-9]/[A-Z0-9]" re-search-forward . (lambda (str) (replace-regexp-in-string "/" " over " str)))
("{minus1}" . " negative 1 ")
("\\ln" . " natural log ")
("\left" . " left")
("\\tau" . " towe ")
("\\frac{d[a-zA-Z_0-9\s\\\\]+}{d[a-zA-Z0-9_\s\\\\]+}" re-search-forward . (lambda (str) (concat " d " (s-join " D " (split-string (substring str 6 (- (length str) 1)) "}{d")) " ")))
("\\frac{[a-zA-Z_0-9\s\\\\]}{[a-zA-Z0-9_\s\\\\]}" re-search-forward . (lambda (str) (concat " " (s-join " over " (split-string (substring str 5 (- (length str) 1)) "}{")) " ")))
("\\frac{[a-zA-Z_0-9\s\\\\]+}{[a-zA-Z0-9_\s\\\\]+}" re-search-forward . (lambda (str) (concat " fraction " (substring str 5 (- (length str) 1)) " ")))
("\\pdiff{[a-zA-Z_0-9\s\\\\]+}{[a-zA-Z0-9_\s\\\\]+}" re-search-forward . (lambda (str) (concat " partial " (s-join " over partial " (split-string (substring str 6 (- (length str) 1)) "}{")) " ")))
("\\pardiffdiff{[a-zA-Z_0-9\s\\\\]+}{[a-zA-Z0-9_\s\\\\]+}{[2]+}" re-search-forward . (lambda (str) (concat " partial squared " (s-join " over partial " (split-string (substring str 9 (- (length str) 4)) "}{")) " squared ")))
("\\pardiff{[a-zA-Z_0-9\s\\\\]+}{[a-zA-Z0-9_\s\\\\]+}" re-search-forward . (lambda (str) (concat " partial " (s-join " over partial " (split-string (substring str 8 (- (length str) 1)) "}{")) " ")))
("\\\\diff{[a-zA-Z_0-9\s\\\\]+}{[a-zA-Z0-9_\s\\\\]+}" re-search-forward . (lambda (str) (concat " d " (s-join " D " (split-string (substring str 6 (- (length str) 1)) "}{")) " ")))
("\\frac". " fraction ")
("\\;" . " dot ")
("\\geq" . " greater than or equal to ")
("\\leq" . " less than or equal to ")
("\\ge" . " greater than ")
("\\le" . " less than ")
("&=" . " equal to ")
("\\cdot" . " dot ")
("\\sqrt" . " square root")
("\\gamma" . " gamma")
("^2" . " squared ")
("{AB}" . "{A B}")
("_a" . " sub ay ")
("\\mod" . " modulo ")
("$" . " ")
("x_0" . "x0")
("_" . " sub ")
("^" . " to the power of ")
("\\vec{[a-zA-Z0-9]}" re-search-forward . (lambda (str) (concat " vec " (substring str 4 5) " ")))
("{". " start ")
("}" . " end ")
("\\" . " ")
))