Newer
Older
# mathMLMap.csv
# - file to translate .lg files to Presentation MathML format
# repr. of expression structure.
#
# For latex symbols, both versions with an initial backslash (\) and without
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
# are included in the symbol mapping table below.
#
# SYNONYMNS for SYMBOL NAMES:
#
# Note that some symbols have synonymns - these are being
# mapped to a single output representation:
# - <, \lt, \langle
# - Integral, \int
# - Sigma, \sum
SYMBOLS
# Letters
a,->,<mi xml:id=_I_>a</mi>
b,->,<mi xml:id=_I_>b</mi>
c,->,<mi xml:id=_I_>c</mi>
d,->,<mi xml:id=_I_>d</mi>
e,->,<mi xml:id=_I_>e</mi>
f,->,<mi xml:id=_I_>f</mi>
g,->,<mi xml:id=_I_>g</mi>
h,->,<mi xml:id=_I_>h</mi>
i,->,<mi xml:id=_I_>i</mi>
j,->,<mi xml:id=_I_>j</mi>
k,->,<mi xml:id=_I_>k</mi>
l,->,<mi xml:id=_I_>l</mi>
m,->,<mi xml:id=_I_>m</mi>
n,->,<mi xml:id=_I_>n</mi>
o,->,<mi xml:id=_I_>o</mi>
p,->,<mi xml:id=_I_>p</mi>
q,->,<mi xml:id=_I_>q</mi>
r,->,<mi xml:id=_I_>r</mi>
s,->,<mi xml:id=_I_>s</mi>
t,->,<mi xml:id=_I_>t</mi>
u,->,<mi xml:id=_I_>u</mi>
v,->,<mi xml:id=_I_>v</mi>
w,->,<mi xml:id=_I_>w</mi>
x,->,<mi xml:id=_I_>x</mi>
y,->,<mi xml:id=_I_>y</mi>
z,->,<mi xml:id=_I_>z</mi>
A,->,<mi xml:id=_I_>A</mi>
B,->,<mi xml:id=_I_>B</mi>
C,->,<mi xml:id=_I_>C</mi>
# NOTE: D is not included in CROHME 2013.
#D,->,<mi xml:id=_I_>D</mi>
E,->,<mi xml:id=_I_>E</mi>
F,->,<mi xml:id=_I_>F</mi>
G,->,<mi xml:id=_I_>G</mi>
H,->,<mi xml:id=_I_>H</mi>
I,->,<mi xml:id=_I_>I</mi>
# NOTE: J, K are not included in CROHME 2013.
L,->,<mi xml:id=_I_>L</mi>
M,->,<mi xml:id=_I_>M</mi>
N,->,<mi xml:id=_I_>N</mi>
P,->,<mi xml:id=_I_>P</mi>
# NOTE: Q is not included in CROHME 2013.
R,->,<mi xml:id=_I_>R</mi>
S,->,<mi xml:id=_I_>S</mi>
T,->,<mi xml:id=_I_>T</mi>
# NOTE: U is not inclided in CROHME 2013
#U,->,<mi xml:id=_I_>U</mi>
V,->,<mi xml:id=_I_>V</mi>
# NOTE: W is not included in CROHME 2013
#W,->,<mi xml:id=_I_>W</mi>
X,->,<mi xml:id=_I_>X</mi>
Y,->,<mi xml:id=_I_>Y</mi>
# NOTE: Z is not included in CROHME 2013
# Digits
0,->,<mn xml:id=_I_>0</mn>
1,->,<mn xml:id=_I_>1</mn>
2,->,<mn xml:id=_I_>2</mn>
3,->,<mn xml:id=_I_>3</mn>
4,->,<mn xml:id=_I_>4</mn>
5,->,<mn xml:id=_I_>5</mn>
6,->,<mn xml:id=_I_>6</mn>
7,->,<mn xml:id=_I_>7</mn>
8,->,<mn xml:id=_I_>8</mn>
9,->,<mn xml:id=_I_>9</mn>
# Greek Letters
\alpha,->,<mi xml:id=_I_>α</mi>
\beta,->,<mi xml:id=_I_>β</mi>
\gamma,->,<mi xml:id=_I_>γ</mi>
\lambda,->,<mi xml:id=_I_>λ</mi>
\omega,->,<mi xml:id=_I_>ω</mi>
\phi,->,<mi xml:id=_I_>φ</mi>
\pi,->,<mi xml:id=_I_>π</mi>
\Pi,->,<mi xml:id=_I_>π</mi>
\theta,->,<mi xml:id=_I_>θ</mi>
\sigma,->,<mi xml:id=_I_>σ</mi>
\mu,->,<mi xml:id=_I_>μ</mi>
\Delta,->,<mi xml:id=_I_>Δ</mi>
alpha,->,<mi xml:id=_I_>α</mi>
beta,->,<mi xml:id=_I_>β</mi>
gamma,->,<mi xml:id=_I_>γ</mi>
lambda,->,<mi xml:id=_I_>λ</mi>
omega,->,<mi xml:id=_I_>ω</mi>
phi,->,<mi xml:id=_I_>φ</mi>
pi,->,<mi xml:id=_I_>π</mi>
Pi,->,<mi xml:id=_I_>π</mi>
#tau,->,<mi xml:id=_I_>τ</mi>
#psi,->,<mi xml:id=_I_>ψ</mi>
#epsilon,->,<mi xml:id=_I_>ε</mi>
#Pi,->,<mi xml:id=_I_>Π</mi>
theta,->,<mi xml:id=_I_>θ</mi>
#Theta,->,<mi xml:id=_I_>θ</mi>
sigma,->,<mi xml:id=_I_>σ</mi>
mu,->,<mi xml:id=_I_>μ</mi>
Delta,->,<mi xml:id=_I_>Δ</mi>
\infty,->,<mi xml:id=_I_>∞</mi>
infin,->,<mi xml:id=_I_>∞</mi>
infinity,->,<mi xml:id=_I_>∞</mi>
\Real,->,<mi xml:id=_I_>&Real;</mi>
infty,->,<mi xml:id=_I_>∞</mi>
Real,->,<mi xml:id=_I_>&Real;</mi>
# Arithmetic Operators
+,->,<mo xml:id=_I_>+</mo>
-,->,<mo xml:id=_I_>-</mo>
horizontal-line,->,<mo xml:id=_I_>-</mo>
\pm,->,<mo xml:id=_I_>±</mo>
\div,->,<mo xml:id=_I_>÷</mo>
\times,->,<mo xml:id=_I_>×</mo>
\ast,->,<mo xml:id=_I_>*</mo>
plus,->,<mo xml:id=_I_>+</mo>
minus,->,<mo xml:id=_I_>-</mo>
pm,->,<mo xml:id=_I_>±</mo>
div,->,<mo xml:id=_I_>÷</mo>
times,->,<mo xml:id=_I_>×</mo>
ast,->,<mo xml:id=_I_>*</mo>
\wedge,->,<mo xml:id=_I_>∧</mo>
\vee,->,<mo xml:id=_I_>∨</mo>
\rightarrow,->,<mo xml:id=_I_>→</mo>
\supset,->,<mo xml:id=_I_>⊃</mo>
\subset,->,<mo xml:id=_I_>⊂</mo>
\forall,->,<mo xml:id=_I_>∀</mo>
\exists,->,<mo xml:id=_I_>∃</mo>
wedge,->,<mo xml:id=_I_>∧</mo>
vee,->,<mo xml:id=_I_>∨</mo>
rightarrow,->,<mo xml:id=_I_>→</mo>
supset,->,<mo xml:id=_I_>⊃</mo>
subset,->,<mo xml:id=_I_>⊂</mo>
forall,->,<mo xml:id=_I_>∀</mo>
exists,->,<mo xml:id=_I_>∃</mo>
# Misc
prime,->,<mo xml:id=_I_>\'</mo>
\',->,<mo xml:id=_I_>\'</mo>
\partial,->,<mo xml:id=_I_>∂</mo>
partial,->,<mo xml:id=_I_>∂</mo>
\cup,->,<mo xml:id=_I_>∪</mo>
\cap,->,<mo xml:id=_I_>∩</mo>
\in,->,<mo xml:id=_I_>∈</mo>
cup,->,<mo xml:id=_I_>∪</mo>
cap,->,<mo xml:id=_I_>∩</mo>
in,->,<mo xml:id=_I_>∈</mo>
\log,->,<mi xml:id=_I_>&log;</mi>
\sin,->,<mi xml:id=_I_>&sin;</mi>
\cos,->,<mi xml:id=_I_>&cos;</mi>
\tan,->,<mi xml:id=_I_>&tan;</mi>
\neq,->,<mi xml:id=_I_>≠</mi>
\leq,->,<mi xml:id=_I_>≤</mi>
\geq,->,<mi xml:id=_I_>≥</mi>
equals,->,<mo xml:id=_I_>=</mo>
# !! Note: we have synonymns here; mapping to same MathML objects.
<,->,<mo xml:id=_I_><</mo>
>,->,<mo xml:id=_I_>></mo>
\lt,->,<mo xml:id=_I_><</mo>
<,->,<mo xml:id=_I_><</mo>
\gt,->,<mo xml:id=_I_>></mo>
>,->,<mo xml:id=_I_>></mo>
log,->,<mi xml:id=_I_>&log;</mi>
sin,->,<mi xml:id=_I_>&sin;</mi>
cos,->,<mi xml:id=_I_>&cos;</mi>
tan,->,<mi xml:id=_I_>&tan;</mi>
neq,->,<mi xml:id=_I_>≠</mi>
ne,->,<mi xml:id=_I_>≠</mi>
leq,->,<mi xml:id=_I_>≤</mi>
geq,->,<mi xml:id=_I_>≥</mi>
ge,->,<mi xml:id=_I_>≥</mi>
lt,->,<mo xml:id=_I_><</mo>
gt,->,<mo xml:id=_I_>></mo>
# Punctuation and Elipsis
# NOTE: COMMA symbol id, and quoting used to avoid problems with using ','
COMMA,->,"<mo xml:id=_I_>,</mo>"
",",->,"<mo xml:id=_I_>,</mo>"
.,->,<mo xml:id=_I_>.</mo>
dot,->,<mo xml:id=_I_>.</mo>
rlaz@cs.rit.edu
a validé
cdot,->,<mo xml:id=_I_>.</mo>
ctdot,->,<mo xml:id=_I_>.</mo>
\cdot,->,<mo xml:id=_I_>.</mo>
\ldots,->,<mo xml:id=_I_>…</mo>
\cdots,->,<mo xml:id=_I_>⋯</mo>
ldots,->,<mo xml:id=_I_>…</mo>
cdots,->,<mo xml:id=_I_>⋯</mo>
# Fence symbols (square and angle brackets, parentheses, braces)
(,->,<mi xml:id=_I_>(</mi>
\(,->,<mi xml:id=_I_>(</mi>
lparen,->,<mi xml:id=_I_>(</mi>
left-paren,->,<mi xml:id=_I_>(</mi>
),->,<mi xml:id=_I_>)</mi>
\),->,<mi xml:id=_I_>)</mi>
rparen,->,<mi xml:id=_I_>)</mi>
right-paren,->,<mi xml:id=_I_>)</mi>
\{,->,<mi xml:id=_I_>{</mi>
\},->,<mi xml:id=_I_>}</mi>
{,->,<mi xml:id=_I_>{</mi>
},->,<mi xml:id=_I_>}</mi>
[,->,<mi xml:id=_I_>[</mi>
\[,->,<mi xml:id=_I_>[</mi>
lbracket,->,<mi xml:id=_I_>[</mi>
left-bracket,->,<mi xml:id=_I_>[</mi>
],->,<mi xml:id=_I_>]</mi>
\],->,<mi xml:id=_I_>]</mi>
rbracket,->,<mi xml:id=_I_>]</mi>
right-bracket,->,<mi xml:id=_I_>]</mi>
\langle,->,<mi xml:id=_I_><</mi>
\rangle,->,<mi xml:id=_I_>></mi>
\sum,->,<mo xml:id=_I_>∑</mo>
\int,->,<mo xml:id=_I_>∫</mo>
\lim,->,<mi xml:id=_I_>lim</mi>
sum,->,<mo xml:id=_I_>∑</mo>
int,->,<mo xml:id=_I_>∫</mo>
lim,->,<mi xml:id=_I_>lim;</mi>
Sigma,->,<mo xml:id=_I_>∑</mo>
Integral,->,<mo xml:id=_I_>∫</mo>
integral,->,<mo xml:id=_I_>∫</mo>
# ?? Treating prime (e.g. ' in a') as superscript relative to base.
\prime,->,<mo xml:id=_I_>′</mo>
prime,->,<mo xml:id=_I_>′</mo>
',->,<mo xml:id=_I_>′</mo>
Richard Zanibbi
a validé
# Empty square root.
\sqrt,->,<msqrt xml:id=_I_></msqrt>
sqrt,->,<msqrt xml:id=_I_></msqrt>
Richard Zanibbi
a validé
# Grids
<mtable>,->,<mtable>
<mtr>,->,<mtr>
<mtd>,->,<mtd>
Richard Zanibbi
a validé
# Treat symbol by default as an identifier (_L_ holds symbol label).
OBJ_DEFAULT,->,<mi xml:id=_I_>_L_</mi>
################################################################
# STRUCTURES
#
# Mappings are defined by (symbol, REL1, REL2, ..., RELN) tuples.
# At right of the arrow, subtrees belonging to identified
# relationships may be arranged in the output.
#
# NOTE: relationships on the left side of an arrow are matched
# alphabetically, independent of their order as children.
# This assumes that child relationships are labeled
# uniquely!!
#
# Special Symbol Identifiers:
# ANY: any symbol.
# PARENT: parent symbol in a directed relationship.
# CHILD: child symbol in a directed relationship.
#################################################################
# CROHME 2014: adding relationships for tables/grids (for matrices, etc.)
# WARNING: these will be translated in the order visited in the file - this
# is important if one wishes to keep the order of rows and cells
# consistent with the original file.
<mtable>,GRID,->,<mtable>,GRID,</mtable>
# Map 1st -> n-1st elements (e.g. rows, cells) first.
<mtr>,GRID,NEXT,->,<mtr>,GRID,</mtr>,NEXT
<mtd>,GRID,NEXT,->,<mtd>,GRID,</mtd>,NEXT
# Then map the last row separately (no "NEXT" relationship)
<mtr>,GRID,->,<mtr>,GRID,</mtr>
<mtd>,GRID,->,<mtd>,GRID,</mtd>
# Need to define unique set of labels for the competition.
sqrt,I,->,<msqrt xml:id=_I_>,I,</msqrt>
sqrt,C,->,<msqrt xml:id=_I_>,C,</msqrt>
sqrt,Inside,->,<msqrt xml:id=_I_>,Inside,</msqrt>
rlaz@cs.rit.edu
a validé
\sqrt,I,->,<msqrt xml:id=_I_>,I,</msqrt>
\sqrt,C,->,<msqrt xml:id=_I_>,C,</msqrt>
\sqrt,Inside,->,<msqrt xml:id=_I_>,Inside,</msqrt>
rlaz@cs.rit.edu
a validé
# RZ: Addition for nth-roots (e.g. cube roots, March 25)
sqrt,I,Above,->,<mroot xml:id=_I_>,I,Above,</mroot>
sqrt,C,Above,->,<mroot xml:id=_I_>,C,Above,</mroot>
sqrt,Inside,Above,->,<mroot xml:id=_I_>,Inside,Above,</mroot>
sqrt,I,A,->,<mroot xml:id=_I_>,I,A,</mroot>
sqrt,C,A,->,<mroot xml:id=_I_>,C,A,</mroot>
sqrt,Inside,Above,->,<mroot xml:id=_I_>,Inside,Above,</mroot>
rlaz@cs.rit.edu
a validé
\sqrt,I,A,->,<mroot xml:id=_I_>,I,A,</mroot>
\sqrt,C,A,->,<mroot xml:id=_I_>,C,A,</mroot>
\sqrt,I,Above,->,<mroot xml:id=_I_>,I,Above,</mroot>
\sqrt,C,Above,->,<mroot xml:id=_I_>,C,Above,</mroot>
\sqrt,Inside,Above,->,<mroot xml:id=_I_>,Inside,Above,</mroot>
-,Above,Below,->,<mfrac xml:id=_I_>,Above,Below,</mfrac>
-,A,B,->,<mfrac xml:id=_I_>,A,B,</mfrac>
-,ABOVE,BELOW,->,<mfrac xml:id=_I_>,ABOVE,BELOW,</mfrac>
horizontal-line,ABOVE,BELOW,->,<mfrac xml:id=_I_>,ABOVE,BELOW,</mfrac>
ANY,Above,Below,->,<munderover>,PARENT,Below,Above,</munderover>
ANY,A,B,->,<munderover>,PARENT,B,A,</munderover>
ANY,ABOVE,BELOW,->,<munderover>,PARENT,BELOW,ABOVE,</munderover>
ANY,ULIMIT,LLIMIT,->,<munderover>,PARENT,LLIMIT,ULIMIT,</munderover>
ANY,Sub,Sup,->,<msubsup>,PARENT,Sub,Sup,</msubsup>
ANY,SUB,SUP,->,<msubsup>,PARENT,SUB,SUP,</msubsup>
ANY,SUBSC,SUPER,->,<msubsup>,PARENT,SUBSC,SUPER,</msubsup>
# Individual relationships (arbitrary PARENT/CHILD relationships).
#GRID,->,PARENT,CHILD
Right,->,<mrow>,PARENT,CHILD,</mrow>
R,->,<mrow>,PARENT,CHILD,</mrow>
r,->,<mrow>,PARENT,CHILD,</mrow>
HOR,->,<mrow>,PARENT,CHILD,</mrow>
^,->,<msup>,PARENT,CHILD,</msup>
_,->,<msub>,PARENT,CHILD,</msub>
SUB,->,<msub>,PARENT,CHILD,</msub>
Sub,->,<msub>,PARENT,CHILD,</msub>
sub,->,<msub>,PARENT,CHILD,</msub>
SUBSC,->,<msub>,PARENT,CHILD,</msub>
SUP,->,<msup>,PARENT,CHILD,</msup>
Sup,->,<msup>,PARENT,CHILD,</msup>
sup,->,<msup>,PARENT,CHILD,</msup>
SUPER,->,<msup>,PARENT,CHILD,</msup>
A,->,<munder>,CHILD,PARENT,</munder>
ABOVE,->,<munder>,CHILD,PARENT,</munder>
Above,->,<munder>,CHILD,PARENT,</munder>
a,->,<munder>,CHILD,PARENT,</munder>
ULIMIT,->,<munder>,CHILD,PARENT,</munder>
BELOW,->,<munder>,PARENT,CHILD,</munder>
Below,->,<munder>,PARENT,CHILD,</munder>
LLIMIT,->,<munder>,PARENT,CHILD,</munder>
REL_DEFAULT,->,<mrow>,PARENT,CHILD,</mrow>
#REL_DEFAULT,->,PARENT,CHILD
#%REL_DEFAULT,->,<mrow>,PARENT,CHILD,</mrow>