plurimath 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +33 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +2 -0
  5. data/AsciiMath-Supported-Data.adoc +280 -0
  6. data/Gemfile +1 -0
  7. data/Latex-Supported-Data.adoc +1872 -0
  8. data/MathML-Supported-Data.adoc +270 -0
  9. data/README.adoc +94 -0
  10. data/lib/plurimath/asciimath/constants.rb +301 -0
  11. data/lib/plurimath/asciimath/parse.rb +121 -0
  12. data/lib/plurimath/asciimath/parser.rb +25 -0
  13. data/lib/plurimath/asciimath/transform.rb +395 -0
  14. data/lib/plurimath/asciimath.rb +16 -0
  15. data/lib/plurimath/html/constants.rb +50 -0
  16. data/lib/plurimath/html/parse.rb +149 -0
  17. data/lib/plurimath/html/parser.rb +26 -0
  18. data/lib/plurimath/html/transform.rb +363 -0
  19. data/lib/plurimath/html.rb +15 -0
  20. data/lib/plurimath/latex/constants.rb +1990 -0
  21. data/lib/plurimath/latex/parse.rb +198 -0
  22. data/lib/plurimath/latex/parser.rb +25 -0
  23. data/lib/plurimath/latex/transform.rb +458 -0
  24. data/lib/plurimath/latex.rb +15 -0
  25. data/lib/plurimath/math/formula.rb +51 -0
  26. data/lib/plurimath/math/function/abs.rb +12 -0
  27. data/lib/plurimath/math/function/arccos.rb +12 -0
  28. data/lib/plurimath/math/function/arcsin.rb +12 -0
  29. data/lib/plurimath/math/function/arctan.rb +12 -0
  30. data/lib/plurimath/math/function/bar.rb +16 -0
  31. data/lib/plurimath/math/function/base.rb +36 -0
  32. data/lib/plurimath/math/function/binary_function.rb +58 -0
  33. data/lib/plurimath/math/function/cancel.rb +12 -0
  34. data/lib/plurimath/math/function/ceil.rb +12 -0
  35. data/lib/plurimath/math/function/color.rb +23 -0
  36. data/lib/plurimath/math/function/cos.rb +12 -0
  37. data/lib/plurimath/math/function/cosh.rb +12 -0
  38. data/lib/plurimath/math/function/cot.rb +12 -0
  39. data/lib/plurimath/math/function/coth.rb +12 -0
  40. data/lib/plurimath/math/function/csc.rb +12 -0
  41. data/lib/plurimath/math/function/csch.rb +12 -0
  42. data/lib/plurimath/math/function/ddot.rb +12 -0
  43. data/lib/plurimath/math/function/deg.rb +12 -0
  44. data/lib/plurimath/math/function/det.rb +12 -0
  45. data/lib/plurimath/math/function/dim.rb +12 -0
  46. data/lib/plurimath/math/function/dot.rb +12 -0
  47. data/lib/plurimath/math/function/exp.rb +12 -0
  48. data/lib/plurimath/math/function/f.rb +12 -0
  49. data/lib/plurimath/math/function/fenced.rb +27 -0
  50. data/lib/plurimath/math/function/floor.rb +12 -0
  51. data/lib/plurimath/math/function/font_style/bold.rb +18 -0
  52. data/lib/plurimath/math/function/font_style/double_struck.rb +18 -0
  53. data/lib/plurimath/math/function/font_style/fraktur.rb +18 -0
  54. data/lib/plurimath/math/function/font_style/monospace.rb +18 -0
  55. data/lib/plurimath/math/function/font_style/sans-serif.rb +18 -0
  56. data/lib/plurimath/math/function/font_style/script.rb +18 -0
  57. data/lib/plurimath/math/function/font_style.rb +25 -0
  58. data/lib/plurimath/math/function/frac.rb +23 -0
  59. data/lib/plurimath/math/function/g.rb +12 -0
  60. data/lib/plurimath/math/function/gcd.rb +12 -0
  61. data/lib/plurimath/math/function/glb.rb +12 -0
  62. data/lib/plurimath/math/function/hat.rb +12 -0
  63. data/lib/plurimath/math/function/hom.rb +12 -0
  64. data/lib/plurimath/math/function/inf.rb +17 -0
  65. data/lib/plurimath/math/function/int.rb +17 -0
  66. data/lib/plurimath/math/function/ker.rb +12 -0
  67. data/lib/plurimath/math/function/lcm.rb +12 -0
  68. data/lib/plurimath/math/function/left.rb +20 -0
  69. data/lib/plurimath/math/function/lg.rb +12 -0
  70. data/lib/plurimath/math/function/lim.rb +23 -0
  71. data/lib/plurimath/math/function/liminf.rb +12 -0
  72. data/lib/plurimath/math/function/limits.rb +18 -0
  73. data/lib/plurimath/math/function/limsup.rb +12 -0
  74. data/lib/plurimath/math/function/ln.rb +12 -0
  75. data/lib/plurimath/math/function/log.rb +29 -0
  76. data/lib/plurimath/math/function/lub.rb +12 -0
  77. data/lib/plurimath/math/function/max.rb +12 -0
  78. data/lib/plurimath/math/function/min.rb +12 -0
  79. data/lib/plurimath/math/function/mod.rb +29 -0
  80. data/lib/plurimath/math/function/multiscript.rb +11 -0
  81. data/lib/plurimath/math/function/norm.rb +16 -0
  82. data/lib/plurimath/math/function/obrace.rb +12 -0
  83. data/lib/plurimath/math/function/oint.rb +17 -0
  84. data/lib/plurimath/math/function/over.rb +29 -0
  85. data/lib/plurimath/math/function/overset.rb +23 -0
  86. data/lib/plurimath/math/function/power.rb +36 -0
  87. data/lib/plurimath/math/function/power_base.rb +33 -0
  88. data/lib/plurimath/math/function/prod.rb +29 -0
  89. data/lib/plurimath/math/function/right.rb +24 -0
  90. data/lib/plurimath/math/function/root.rb +23 -0
  91. data/lib/plurimath/math/function/sec.rb +12 -0
  92. data/lib/plurimath/math/function/sech.rb +12 -0
  93. data/lib/plurimath/math/function/sin.rb +12 -0
  94. data/lib/plurimath/math/function/sinh.rb +12 -0
  95. data/lib/plurimath/math/function/sqrt.rb +16 -0
  96. data/lib/plurimath/math/function/stackrel.rb +12 -0
  97. data/lib/plurimath/math/function/substack.rb +17 -0
  98. data/lib/plurimath/math/function/sum.rb +29 -0
  99. data/lib/plurimath/math/function/sup.rb +12 -0
  100. data/lib/plurimath/math/function/table/align.rb +24 -0
  101. data/lib/plurimath/math/function/table/array.rb +25 -0
  102. data/lib/plurimath/math/function/table/bmatrix.rb +26 -0
  103. data/lib/plurimath/math/function/table/matrix.rb +24 -0
  104. data/lib/plurimath/math/function/table/multline.rb +24 -0
  105. data/lib/plurimath/math/function/table/pmatrix.rb +24 -0
  106. data/lib/plurimath/math/function/table/split.rb +24 -0
  107. data/lib/plurimath/math/function/table/vmatrix.rb +25 -0
  108. data/lib/plurimath/math/function/table.rb +54 -0
  109. data/lib/plurimath/math/function/tan.rb +12 -0
  110. data/lib/plurimath/math/function/tanh.rb +12 -0
  111. data/lib/plurimath/math/function/td.rb +32 -0
  112. data/lib/plurimath/math/function/ternary_function.rb +52 -0
  113. data/lib/plurimath/math/function/text.rb +44 -0
  114. data/lib/plurimath/math/function/tilde.rb +12 -0
  115. data/lib/plurimath/math/function/tr.rb +30 -0
  116. data/lib/plurimath/math/function/ubrace.rb +12 -0
  117. data/lib/plurimath/math/function/ul.rb +12 -0
  118. data/lib/plurimath/math/function/unary_function.rb +46 -0
  119. data/lib/plurimath/math/function/underover.rb +12 -0
  120. data/lib/plurimath/math/function/underset.rb +12 -0
  121. data/lib/plurimath/math/function/vec.rb +16 -0
  122. data/lib/plurimath/math/function.rb +14 -0
  123. data/lib/plurimath/math/number.rb +37 -0
  124. data/lib/plurimath/math/symbol.rb +43 -0
  125. data/lib/plurimath/math.rb +56 -0
  126. data/lib/plurimath/mathml/constants.rb +295 -0
  127. data/lib/plurimath/mathml/parse.rb +68 -0
  128. data/lib/plurimath/mathml/parser.rb +26 -0
  129. data/lib/plurimath/mathml/transform.rb +200 -0
  130. data/lib/plurimath/mathml.rb +16 -0
  131. data/lib/plurimath/omml/constants.rb +154 -0
  132. data/lib/plurimath/omml/parser.rb +22 -0
  133. data/lib/plurimath/omml/transform.rb +216 -0
  134. data/lib/plurimath/omml.rb +15 -0
  135. data/lib/plurimath/unicode.rb +15 -0
  136. data/lib/plurimath/unitsml.rb +15 -0
  137. data/lib/plurimath/utility.rb +73 -0
  138. data/lib/plurimath/version.rb +3 -1
  139. data/lib/plurimath.rb +3 -5
  140. data/plurimath.gemspec +4 -3
  141. metadata +169 -9
  142. data/README.md +0 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d753ecd87f98bee9b8ce86a97c884f6faf5d80054779b0e614b81cee83f122c
4
- data.tar.gz: 48e00ea65c235d43ec0acf12dc89a6491bc3bea261bfdc2930c54f6772b8e684
3
+ metadata.gz: ce5b6d227ef93e05904c1e2cb12395c91db94b5bb130cebd353dd44032c601e7
4
+ data.tar.gz: 8ce1de0731d04885e3e5222dfda74c690901bda29422009403707495003ed36a
5
5
  SHA512:
6
- metadata.gz: '08c01a96cc02476603a6a0cece4703fdd096ea166eb4e2117e185ff8a5dfc2dcb05a6a8a6f2f6526a208763ad2129bfd22d63a1121e347554cfb042deb171798'
7
- data.tar.gz: 5893839b6b1523b2a6610f32e0af5cf67a15340542d031b909aa03b04487f4482fb61f5c33e8ebf3538013d661561c0f0888028bc036937bf1f1a240f5d2b91f
6
+ metadata.gz: 538cbf63e0728928ec36bd387c231268eb2d62364879867c840d93a4ae74dddaf58e74770fde752d01093df4748414e79d85326a29f84e2c911d0ec61f33e343
7
+ data.tar.gz: fb10a0d5123b5d182a1ba4549d8ba4919c742eedb3c57a6d3fbf62d985783f7a94f6cfd81aa993e838cd8a2f4e551b80211b5a96110ed1e792859f2ad0a2f915
@@ -0,0 +1,33 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ tags:
7
+ - '*'
8
+ pull_request:
9
+
10
+ jobs:
11
+ test:
12
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
13
+ runs-on: ${{ matrix.os }}
14
+ continue-on-error: ${{ matrix.experimental }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '2.6', '2.7', '3.0', '3.1' ]
19
+ os: [ 'macos-latest', 'ubuntu-latest', 'windows-latest']
20
+ experimental: [false]
21
+
22
+ steps:
23
+ - uses: actions/checkout@v3
24
+
25
+ - name: Use Ruby
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby }}
29
+ bundler-cache: true
30
+
31
+ - name: Run specs
32
+ run: |
33
+ bundle exec rake
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ /coverage/
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
@@ -0,0 +1,280 @@
1
+ Parenthesis
2
+ --
3
+ |===
4
+ | Open | Close
5
+
6
+ | (: | :)
7
+ | {: | :}
8
+ | ( | )
9
+ | { | }
10
+ | [ | ]
11
+ | \| | \|
12
+ |===
13
+ Classes
14
+ --
15
+ |===
16
+ | Functions | Fonts
17
+
18
+ | stackrel | mathfrak
19
+ | underset | mathcal
20
+ | overset | mathbb
21
+ | cancel | mathsf
22
+ | obrace | mathtt
23
+ | ubrace | mathbf
24
+ | arctan | bbb
25
+ | arcsin | bb
26
+ | arccos | fr
27
+ | color | cc
28
+ | floor | sf
29
+ | tilde | tt
30
+ | oint |
31
+ | root |
32
+ | frac |
33
+ | prod |
34
+ | text |
35
+ | norm |
36
+ | sqrt |
37
+ | cosh |
38
+ | tanh |
39
+ | sinh |
40
+ | sech |
41
+ | csch |
42
+ | coth |
43
+ | ddot |
44
+ | ceil |
45
+ | log |
46
+ | mod |
47
+ | sum |
48
+ | int |
49
+ | vec |
50
+ | hat |
51
+ | dot |
52
+ | bar |
53
+ | abs |
54
+ | min |
55
+ | max |
56
+ | dim |
57
+ | det |
58
+ | csc |
59
+ | cot |
60
+ | lub |
61
+ | lcm |
62
+ | glb |
63
+ | gcd |
64
+ | exp |
65
+ | cos |
66
+ | tan |
67
+ | sin |
68
+ | sec |
69
+ | ln |
70
+ | ul |
71
+ | g |
72
+ | f |
73
+ --
74
+ === Symbols
75
+
76
+ ** twoheadrightarrowtail
77
+ ** twoheadrightarrow
78
+ ** rightarrowtail
79
+ ** Leftrightarrow
80
+ ** leftrightarrow
81
+ ** Rightarrow
82
+ ** rightarrow
83
+ ** varepsilon
84
+ ** Leftarrow
85
+ ** leftarrow
86
+ ** downarrow
87
+ ** therefore
88
+ ** backslash
89
+ ** setminus
90
+ ** triangle
91
+ ** bigwedge
92
+ ** rceiling
93
+ ** lceiling
94
+ ** supseteq
95
+ ** subseteq
96
+ ** vartheta
97
+ ** emptyset
98
+ ** diamond
99
+ ** uparrow
100
+ ** implies
101
+ ** partial
102
+ ** because
103
+ ** upsilon
104
+ ** epsilon
105
+ ** bigcap
106
+ ** bigvee
107
+ ** propto
108
+ ** approx
109
+ ** exists
110
+ ** forall
111
+ ** otimes
112
+ ** ltimes
113
+ ** bowtie
114
+ ** rtimes
115
+ ** models
116
+ ** mapsto
117
+ ** bigcup
118
+ ** succeq
119
+ ** preceq
120
+ ** rfloor
121
+ ** lfloor
122
+ ** square
123
+ ** supset
124
+ ** subset
125
+ ** lambda
126
+ ** Lambda
127
+ ** varphi
128
+ ** >\->>
129
+ ** kappa
130
+ ** Delta
131
+ ** delta
132
+ ** gamma
133
+ ** Gamma
134
+ ** Theta
135
+ ** theta
136
+ ** alpha
137
+ ** aleph
138
+ ** infty
139
+ ** equiv
140
+ ** frown
141
+ ** notin
142
+ ** angle
143
+ ** cdots
144
+ ** vdash
145
+ ** wedge
146
+ ** oplus
147
+ ** nabla
148
+ ** ddots
149
+ ** vdots
150
+ ** Sigma
151
+ ** Omega
152
+ ** omega
153
+ ** sigma
154
+ ** times
155
+ ** ldots
156
+ ** \<\=>
157
+ ** -\<=
158
+ ** \^^^
159
+ ** |\->
160
+ ** >\->
161
+ ** \->>
162
+ ** \_|_
163
+ ** \***
164
+ ** |><|
165
+ ** quad
166
+ ** star
167
+ ** odot
168
+ ** cdot
169
+ ** rarr
170
+ ** darr
171
+ ** prop
172
+ ** lArr
173
+ ** rArr
174
+ ** uarr
175
+ ** hArr
176
+ ** harr
177
+ ** larr
178
+ ** grad
179
+ ** circ
180
+ ** sube
181
+ ** supe
182
+ ** succ
183
+ ** prec
184
+ ** cong
185
+ ** beta
186
+ ** zeta
187
+ ** iota
188
+ ** !in
189
+ ** sup
190
+ ** sub
191
+ ** top
192
+ ** vvv
193
+ ** vee
194
+ ** nnn
195
+ ** cap
196
+ ** ast
197
+ ** bot
198
+ ** del
199
+ ** uuu
200
+ ** cup
201
+ ** iff
202
+ ** eta
203
+ ** Phi
204
+ ** Psi
205
+ ** psi
206
+ ** chi
207
+ ** phi
208
+ ** rho
209
+ ** tau
210
+ ** div
211
+ ** neg
212
+ ** not
213
+ ** /_\
214
+ ** \->
215
+ ** >-=
216
+ ** ><|
217
+ ** |==
218
+ ** |--
219
+ ** __|
220
+ ** |__
221
+ ** |><
222
+ ** \=>
223
+ ** \<=
224
+ ** nn
225
+ ** vv
226
+ ** TT
227
+ ** EE
228
+ ** ox
229
+ ** to
230
+ ** AA
231
+ ** uu
232
+ ** ne
233
+ ** ZZ
234
+ ** RR
235
+ ** QQ
236
+ ** NN
237
+ ** CC
238
+ ** oo
239
+ ** ge
240
+ ** le
241
+ ** in
242
+ ** nu
243
+ ** mu
244
+ ** pi
245
+ ** Pi
246
+ ** xi
247
+ ** Xi
248
+ ** xx
249
+ ** pm
250
+ ** gt
251
+ ** lt
252
+ ** :'
253
+ ** ^^
254
+ ** o+
255
+ ** o.
256
+ ** **
257
+ ** ~~
258
+ ** O/
259
+ ** >>
260
+ ** <<
261
+ ** ~|
262
+ ** !=
263
+ ** >-
264
+ ** -<
265
+ ** ~=
266
+ ** -=
267
+ ** :.
268
+ ** >=
269
+ ** |~
270
+ ** /_
271
+ ** +-
272
+ ** -:
273
+ ** @
274
+ ** *
275
+ ** <
276
+ ** >
277
+ ** -
278
+ ** =
279
+ ** +
280
+ ** /
data/Gemfile CHANGED
@@ -5,3 +5,4 @@ gemspec
5
5
 
6
6
  gem "rake", "~> 12.0"
7
7
  gem "rspec", "~> 3.0"
8
+ gem 'simplecov', require: false, group: :test