plurimath 0.8.0 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,444 @@
1
+ == UnitsML Support
2
+
3
+ === UNITS
4
+
5
+ * `ton-force (2000 lb)` => `ton-force (2000 lb)`
6
+ * `fl oz (US label)` => `fl oz (US label)`
7
+ * `e^2*a_0^2*(E_h)^-1` => `𝑒²𝑎₀²/𝐸ₕ`
8
+ * `oz (US label)` => `oz (US label)`
9
+ * `liq pint (US)` => `liq pint (US)`
10
+ * `e^3a_0^3*(E_h^3)` => `𝑒³𝑎₀³𝐸ₕ³`
11
+ * `e^4a_0^4*(E_h^3)` => `𝑒⁴𝑎₀⁴𝐸ₕ⁴`
12
+ * `in^3_section_modulus` => `in³`
13
+ * `e^2*a_0^2*m_e-1` => `𝑒²𝑎₀²/𝑚ₑ`
14
+ * `h-bar*(e*a_0^2)-1` => `ℏ/𝑒𝑎₀²`
15
+ * `e^2*(a_0*E_h)-1` => `𝑒²/𝑎₀𝐸ₕ`
16
+ * `dry pt (US)` => `dry pt (US)`
17
+ * `J*mol^-1*K^-1` => `J/(mol·K)`
18
+ * `dry qt (US)` => `dry qt (US)`
19
+ * `statcoulomb` => `statcoulomb`
20
+ * `liq qt (US)` => `liq qt (US)`
21
+ * `a_0*E_h*h-bar-1` => `𝑎₀𝐸ₕ/ℏ`
22
+ * `W*m^-2*sr^-1` => `W/(m²·sr)`
23
+ * `kcal_th*s^-1` => `kcal_th/s`
24
+ * `h-bar*(m_e*c^2)` => `ℏ/𝑚ₑ𝑐²`
25
+ * `E_h*(e*a_0^2)` => `𝐸ₕ/𝑒𝑎₀²`
26
+ * `ton_refrigeration` => `ton`
27
+ * `dwt (troy)` => `dwt (troy)`
28
+ * `J*kg^-1*K^-1` => `J/(kg·K)`
29
+ * `fl oz (UK)` => `fl oz (UK)`
30
+ * `fl oz (US)` => `fl oz (US)`
31
+ * `h-bar*e*(m_e)-1` => `ℏ𝑒/𝑚ₑ`
32
+ * `dprime_Hg_60degF` => `″Hg`
33
+ * `dprime_Hg_32degF` => `″Hg`
34
+ * `ft*lbf*s^-1` => `ft·lbf/2`
35
+ * `cal_th*s^-1` => `cal_th/s`
36
+ * `N*m^2*kg^-2` => `N·m²/kg²`
37
+ * `W*m^-2*K^-1` => `W/(m²·K)`
38
+ * `eE_h*h-bar^-1` => `𝑒𝐸ₕ/ℏ`
39
+ * `ftH_2O_39degF` => `ftH₂O`
40
+ * `h-bar*(E_h)-1` => `ℏ/𝐸ₕ`
41
+ * `dr (avdp)` => `dr (avdp)`
42
+ * `scr (ap.)` => `scr (ap.)`
43
+ * `W*m^-1*K^-1` => `W/(m·K)`
44
+ * `kgf*s^2/m` => `kgf·s²m⁻¹`
45
+ * `kg*m^2*s^-1` => `kg·m²/s`
46
+ * `inH_2O_39degF` => `inH₂O`
47
+ * `inH_2O_60degF` => `inH₂O`
48
+ * `E_h*(e*a_0)` => `𝐸ₕ/𝑒𝑎₀`
49
+ * `ft^3*min^-1` => `ft³min`
50
+ * `kgf*m*s^-1` => `kgf·m/s`
51
+ * `ft*min^-1` => `ft·min⁻¹`
52
+ * `dyn*cm^-2` => `dyn·cm⁻²`
53
+ * `kgf*cm^-2` => `kgf·cm⁻²`
54
+ * `kgf*mm^-2` => `kgf·mm⁻²`
55
+ * `mi*min^-1` => `mi·min⁻¹`
56
+ * `cmH_2O_4degC` => `cmH₂O`
57
+ * `ft^3*sec^-1` => `ft³sec`
58
+ * `in^3*min^-1` => `in³min`
59
+ * `E_h*(a_0)-1` => `𝐸ₕ/𝑎₀`
60
+ * `h-bar*(a_0)-1` => `ℏ/𝑎₀`
61
+ * `a_tropical_year` => `a`
62
+ * `cwt (US)` => `cwt (US)`
63
+ * `cwt (UK)` => `cwt (UK)`
64
+ * `bbl (US)` => `bbl (US)`
65
+ * `gal (US)` => `gal (US)`
66
+ * `gal (UK)` => `gal (UK)`
67
+ * `thm (EC)` => `thm (EC)`
68
+ * `rad_radiation` => `rad`
69
+ * `thm (US)` => `thm (US)`
70
+ * `statwatt` => `statwatt`
71
+ * `a_sidereal_year` => `a`
72
+ * `mol*kg^-1` => `mol/kg`
73
+ * `pica_computer` => `pc`
74
+ * `lambda-bar_C` => `ƛ_C`
75
+ * `aW (Cardelli)` => `aW`
76
+ * `mol*m^-3` => `mol·m⁻³`
77
+ * `erg*s^-1` => `erg·s⁻¹`
78
+ * `kgf*m^-2` => `kgf·m⁻²`
79
+ * `gf*cm^-2` => `gf·cm⁻²`
80
+ * `inHg_60degF` => `inHg`
81
+ * `inHg_32degF` => `inHg`
82
+ * `min_sidereal` => `min`
83
+ * `m_e*c^2_MeV` => `𝑚ₑ𝑐²`
84
+ * `mi_US_survey` => `mi`
85
+ * `statohm` => `statohm`
86
+ * `ft^2*s^-1` => `ft²/s`
87
+ * `kat*m^-3` => `kat/m³`
88
+ * `kcal_IT` => `kcal_IT`
89
+ * `kcal_th` => `kcal_th`
90
+ * `rad*s^-2` => `rad/s²`
91
+ * `cmHg_0degC` => `cmHg`
92
+ * `lb*ft^-3` => `lb/ft³`
93
+ * `pt (UK)` => `pt (UK)`
94
+ * `bu (US)` => `bu (US)`
95
+ * `kg*m*s^-1` => `N·m/s`
96
+ * `statmho` => `statmho`
97
+ * `pica_printer` => `pc`
98
+ * `yd_US_survey` => `yd`
99
+ * `tbsp_label` => `tbsp`
100
+ * `ft_US_survey` => `ft`
101
+ * `in_US_survey` => `in`
102
+ * `qt (UK)` => `qt (UK)`
103
+ * `m_e*c_MeV/C` => `𝑚ₑ𝑐`
104
+ * `gal*min^-1` => `gpm`
105
+ * `rad*m^-1` => `rad/m`
106
+ * `hp_electric` => `hp`
107
+ * `cd*m^-2` => `cd·m⁻²`
108
+ * `ft*s^-1` => `ft·s⁻¹`
109
+ * `in*s^-1` => `in·s⁻¹`
110
+ * `mi*h^-1` => `mi·h⁻¹`
111
+ * `mi*s^-1` => `mi·s⁻¹`
112
+ * `kg*m^-3` => `kg·m⁻³`
113
+ * `J*mol^-1` => `J/mol`
114
+ * `rad*s^-1` => `rad/s`
115
+ * `"Hg_32degF` => `″Hg`
116
+ * `pt_computer` => `pt`
117
+ * `"Hg_60degF` => `″Hg`
118
+ * `Btu_39degF` => `Btu`
119
+ * `Btu_59degF` => `Btu`
120
+ * `Btu_60degF` => `Btu`
121
+ * `h-bar_atomic` => `ℏ`
122
+ * `gi_imperial` => `gi`
123
+ * `mol*L^-1` => `mol/L`
124
+ * `mol*l^-1` => `mol/l`
125
+ * `e*(a_0^3)` => `𝑒𝑎₀³`
126
+ * `m_e_atomic` => `𝑚ₑ`
127
+ * `mi/gal` => `mi/gal`
128
+ * `statWb` => `statWb`
129
+ * `tsp_label` => `tsp`
130
+ * `ft*s^-2` => `ft/s²`
131
+ * `kg*m^-2` => `kg/m²`
132
+ * `cal_IT` => `cal_IT`
133
+ * `cal_th` => `cal_th`
134
+ * `ft*lbf` => `ft·lbf`
135
+ * `m^2*s^-1` => `m²/s`
136
+ * `m^3*s^-1` => `m³/s`
137
+ * `lbf*in^-2` => `psi`
138
+ * `cup_label` => `cup`
139
+ * `dprime_Hg` => `″Hg`
140
+ * `Btu_th` => `Btu_th`
141
+ * `pt_printer` => `pt`
142
+ * `E_h*e-1` => `𝐸ₕ/𝑒`
143
+ * `mil_nato` => `mil`
144
+ * `Btu_mean` => `Btu`
145
+ * `h-bar_eV_s` => `ℏ`
146
+ * `hp_boiler` => `hp`
147
+ * `W*sr^-1` => `W/sr`
148
+ * `J*kg^-1` => `J/kg`
149
+ * `m*s^-1` => `m·s⁻¹`
150
+ * `m^3*kg` => `m³·kg`
151
+ * `m*s^-2` => `m·s⁻²`
152
+ * `A*m^-2` => `A·m⁻²`
153
+ * `A*m^-1` => `A·m⁻¹`
154
+ * `C*kg^-1` => `C/kg`
155
+ * `Gy*s^-1` => `Gy/s`
156
+ * `Np*s^-1` => `Np/s`
157
+ * `Pa*K^-1` => `Pa/K`
158
+ * `kg*s^-1` => `kg/s`
159
+ * `kg*m^-1` => `kg/m`
160
+ * `kg*m^2` => `kg·m²`
161
+ * `kg*l^-1` => `kg/l`
162
+ * `hp_metric` => `hp`
163
+ * `mmH_2O` => `mmH₂O`
164
+ * `ftH_2O` => `ftH₂O`
165
+ * `cmH_2O` => `cmH₂O`
166
+ * `inH_2O` => `inH₂O`
167
+ * `prime_Hg` => `′Hg`
168
+ * `d_sidereal` => `d`
169
+ * `h_sidereal` => `h`
170
+ * `s_sidereal` => `s`
171
+ * `m_e*c^2` => `𝑚ₑ𝑐²`
172
+ * `e*a_0^2` => `𝑒𝑎₀²`
173
+ * `gpm` => `gal/min`
174
+ * `J*m^-3` => `J/m³`
175
+ * `W*m^-2` => `W/m²`
176
+ * `kgf*m` => `kgf·m`
177
+ * `fermi` => `fermi`
178
+ * `dprime_in` => `″`
179
+ * `abS` => `(abΩ)⁻¹`
180
+ * `prime_min` => `′`
181
+ * `ton_TNT` => `ton`
182
+ * `C*m^-3` => `C/m³`
183
+ * `C*m^-2` => `C/m²`
184
+ * `barye` => `barye`
185
+ * `psi` => `lbf/in²`
186
+ * `N*m*s` => `N·m·s`
187
+ * `t*m^-3` => `t/m³`
188
+ * `ton_short` => `t`
189
+ * `lbmol` => `lbmol`
190
+ * `hp_water` => `hp`
191
+ * `statT` => `statT`
192
+ * `statF` => `statF`
193
+ * `statA` => `statA`
194
+ * `statV` => `statV`
195
+ * `statH` => `statH`
196
+ * `shake` => `shake`
197
+ * `fl dr` => `fl dr`
198
+ * `ac*ft` => `ac·ft`
199
+ * `F*m^-1` => `F/m`
200
+ * `V*m^-1` => `V/m`
201
+ * `J*K^-1` => `J/K`
202
+ * `N*m^-1` => `N/m`
203
+ * `prime_ft` => `′`
204
+ * `dprime_s` => `″`
205
+ * `H*m^-1` => `H/m`
206
+ * `ton_long` => `t`
207
+ * `Pa^-1` => `Pa⁻¹`
208
+ * `oz_troy` => `oz`
209
+ * `lb_troy` => `lb`
210
+ * `Lambert` => `L`
211
+ * `l.y.` => `l.y.`
212
+ * `cmHg` => `cmHg`
213
+ * `Torr` => `torr`
214
+ * `slug` => `slug`
215
+ * `mmHg` => `mmHg`
216
+ * `km/h` => `km/h`
217
+ * `Pa*s` => `Pa·s`
218
+ * `abohm` => `abΩ`
219
+ * `kW*h` => `kW·h`
220
+ * `thou` => `thou`
221
+ * `l.w.` => `l.w.`
222
+ * `ft.c` => `ft.c`
223
+ * `ft.L` => `ft.L`
224
+ * `fath` => `fath`
225
+ * `cmil` => `cmil`
226
+ * `tbsp` => `tbsp`
227
+ * `minim` => `min`
228
+ * `inHg` => `inHg`
229
+ * `ftHg` => `ftHg`
230
+ * `l.h.` => `l.h.`
231
+ * `l.m.` => `l.m.`
232
+ * `l.s.` => `l.s.`
233
+ * `mbar` => `mbar`
234
+ * `m_e*c` => `𝑚ₑ𝑐`
235
+ * `e*a_0` => `𝑒𝑎₀`
236
+ * `in^4` => `in⁴`
237
+ * `K^-1` => `K⁻¹`
238
+ * `yd^2` => `yd²`
239
+ * `m^-1` => `m⁻¹`
240
+ * `kayser` => `K`
241
+ * `a_year` => `a`
242
+ * `ft^2` => `ft²`
243
+ * `in^2` => `in²`
244
+ * `micron` => `μ`
245
+ * `s^-1` => `s⁻¹`
246
+ * `mi^2` => `mi²`
247
+ * `in^3` => `in³`
248
+ * `ft^3` => `ft³`
249
+ * `yd^3` => `yd³`
250
+ * `dprime` => `″`
251
+ * `byte_B` => `B`
252
+ * `hp_UK` => `hp`
253
+ * `tex` => `tex`
254
+ * `Gal` => `Gal`
255
+ * `bel_B` => `B`
256
+ * `mil` => `mil`
257
+ * `bar` => `bar`
258
+ * `'_min` => `′`
259
+ * `abA` => `abA`
260
+ * `abC` => `abC`
261
+ * `abF` => `abF`
262
+ * `abV` => `abV`
263
+ * `A*h` => `A·h`
264
+ * `erg` => `erg`
265
+ * `abH` => `abH`
266
+ * `Aring` => `Å`
267
+ * `mol` => `mol`
268
+ * `degC` => `°C`
269
+ * `min` => `min`
270
+ * `rad` => `rad`
271
+ * `degK` => `°K`
272
+ * `kat` => `kat`
273
+ * `gamma` => `γ`
274
+ * `rem` => `rem`
275
+ * `W*h` => `W·h`
276
+ * `W*s` => `W·s`
277
+ * `dyn` => `dyn`
278
+ * `kgf` => `kgf`
279
+ * `N*m` => `N·m`
280
+ * `rhe` => `rhe`
281
+ * `atm` => `atm`
282
+ * `darcy` => `d`
283
+ * `Darcy` => `D`
284
+ * `gon` => `gon`
285
+ * `prime` => `′`
286
+ * `cal` => `cal`
287
+ * `pdl` => `pdl`
288
+ * `N*s` => `N·s`
289
+ * `lbf` => `lbf`
290
+ * `J*s` => `J·s`
291
+ * `kip` => `kip`
292
+ * `h-bar` => `ℏ`
293
+ * `e_h` => `𝐸ₕ`
294
+ * `"Hg` => `″Hg`
295
+ * `degR` => `°R`
296
+ * `lnk` => `lnk`
297
+ * `fur` => `fur`
298
+ * `tsp` => `tsp`
299
+ * `'Hg` => `′Hg`
300
+ * `degF` => `°F`
301
+ * `Btu` => `Btu`
302
+ * `den` => `den`
303
+ * `bit` => `bit`
304
+ * `cup` => `cup`
305
+ * `cSt` => `cSt`
306
+ * `uin` => `μin`
307
+ * `mpg` => `mpg`
308
+ * `ppm` => `ppm`
309
+ * `var` => `var`
310
+ * `m_e` => `𝑚ₑ`
311
+ * `'_ft` => `′`
312
+ * `m^3` => `m³`
313
+ * `m^2` => `m²`
314
+ * `"_in` => `″`
315
+ * `barn` => `b`
316
+ * `m^4` => `m⁴`
317
+ * `a_0` => `𝑎₀`
318
+ * `c_0` => `𝑐₀`
319
+ * `"_s` => `″`
320
+ * `Ohm` => `Ω`
321
+ * `deg` => `º`
322
+ * `cd` => `cd`
323
+ * `kg` => `kg`
324
+ * `in` => `in`
325
+ * `sr` => `sr`
326
+ * `Pa` => `Pa`
327
+ * `Wb` => `Wb`
328
+ * `Bq` => `Bq`
329
+ * `Gy` => `Gy`
330
+ * `Sv` => `Sv`
331
+ * `Hz` => `Hz`
332
+ * `lm` => `lm`
333
+ * `lx` => `lx`
334
+ * `ha` => `ha`
335
+ * `Bi` => `Bi`
336
+ * `Mx` => `Mx`
337
+ * `kp` => `kp`
338
+ * `ft` => `ft`
339
+ * `mi` => `mi`
340
+ * `yd` => `yd`
341
+ * `ph` => `ph`
342
+ * `gr` => `gr`
343
+ * `Ci` => `Ci`
344
+ * `st` => `st`
345
+ * `Gs` => `Gs`
346
+ * `cP` => `cP`
347
+ * `sb` => `sb`
348
+ * `at` => `at`
349
+ * `St` => `St`
350
+ * `Oe` => `Oe`
351
+ * `as` => `as`
352
+ * `kn` => `kn`
353
+ * `Np` => `Np`
354
+ * `dB` => `dB`
355
+ * `ua` => `ua`
356
+ * `pc` => `pc`
357
+ * `gf` => `gf`
358
+ * `lb` => `lb`
359
+ * `oz` => `oz`
360
+ * `ct` => `ct`
361
+ * `Gi` => `Gi`
362
+ * `dr` => `dr`
363
+ * `eV` => `eV`
364
+ * `rd` => `rd`
365
+ * `hp` => `hp`
366
+ * `Da` => `Da`
367
+ * `ch` => `ch`
368
+ * `ac` => `ac`
369
+ * `pH` => `pH`
370
+ * `pk` => `pk`
371
+ * `gi` => `gi`
372
+ * `mL` => `mL`
373
+ * `ml` => `ml`
374
+ * `m` => `m`
375
+ * `s` => `s`
376
+ * `A` => `A`
377
+ * `K` => `K`
378
+ * `N` => `N`
379
+ * `J` => `J`
380
+ * `W` => `W`
381
+ * `C` => `C`
382
+ * `V` => `V`
383
+ * `F` => `F`
384
+ * `S` => `S`
385
+ * `T` => `T`
386
+ * `H` => `H`
387
+ * `g` => `g`
388
+ * `h` => `h`
389
+ * `d` => `d`
390
+ * `a` => `a`
391
+ * `t` => `t`
392
+ * `R` => `R`
393
+ * `P` => `P`
394
+ * `l` => `l`
395
+ * `L` => `L`
396
+ * `M` => `M`
397
+ * `1` => `1`
398
+ * `D` => `D`
399
+ * `u` => `u`
400
+ * `c` => `𝑐`
401
+ * `e` => `𝑒`
402
+ * `"` => `″`
403
+ * `'` => `′`
404
+
405
+ == DIMENSIONS
406
+
407
+ * `dim_Theta` => `𝝧`
408
+ * `dim_phi` => `𝞅`
409
+ * `dim_L` => `𝖫`
410
+ * `dim_M` => `𝖬`
411
+ * `dim_T` => `𝖨`
412
+ * `dim_N` => `𝖭`
413
+ * `dim_J` => `𝖩`
414
+
415
+ == PREFIX
416
+
417
+ * `da` => `da`
418
+ * `Ki` => `Ki`
419
+ * `Mi` => `Mi`
420
+ * `Gi` => `Gi`
421
+ * `Ti` => `Ti`
422
+ * `Pi` => `Pi`
423
+ * `Ei` => `Ei`
424
+ * `Zi` => `Zi`
425
+ * `Yi` => `Yi`
426
+ * `Y` => `Y`
427
+ * `Z` => `Z`
428
+ * `E` => `E`
429
+ * `P` => `P`
430
+ * `T` => `T`
431
+ * `G` => `G`
432
+ * `M` => `M`
433
+ * `k` => `k`
434
+ * `h` => `h`
435
+ * `d` => `d`
436
+ * `c` => `c`
437
+ * `m` => `m`
438
+ * `u` => `μ`
439
+ * `n` => `n`
440
+ * `p` => `p`
441
+ * `f` => `f`
442
+ * `a` => `a`
443
+ * `z` => `z`
444
+ * `y` => `y`
@@ -896,6 +896,11 @@ module Plurimath
896
896
  Math::Formula.new([table] + expr.flatten.compact)
897
897
  end
898
898
 
899
+ rule(table: simple(:table),
900
+ left_right: simple(:left_right)) do
901
+ Math::Formula.new([table, left_right])
902
+ end
903
+
899
904
  rule(table: simple(:table),
900
905
  expr: simple(:expr)) do
901
906
  formula_array = [table]
@@ -288,26 +288,19 @@ module Plurimath
288
288
 
289
289
  def unitsml_post_processing(nodes)
290
290
  nodes.each.with_index do |node, index|
291
- if node.is_a?(Ox::Element) && node.attributes&.dig(:unitsml)
292
- previous = nodes[index-1]
293
- if previous && ["mi", "mn"].include?(previous.name)
294
- if text_in_tag?(node.nodes)
295
- nodes.insert(index, space_element(attributes: true))
296
- else
297
- nodes.insert(index, space_element)
298
- end
299
- end
300
-
301
- node.attributes.delete_if {|k, v| k == :unitsml }
291
+ if node.is_a?(Ox::Element) && node&.attributes&.dig(:unitsml)
292
+ pre_index = index - 1
293
+ pre_node = nodes[pre_index] if pre_index.zero? || pre_index.positive?
294
+ nodes.insert(index, space_element(node)) if valid_previous?(pre_node)
295
+ node.attributes.delete_if { |k, _| k == :unitsml }
302
296
  end
303
-
304
- unitsml_post_processing(node.nodes) if !node.nodes.any?(String)
297
+ unitsml_post_processing(node.nodes) if node.nodes.none?(String)
305
298
  end
306
299
  end
307
300
 
308
- def space_element(attributes: false)
301
+ def space_element(node)
309
302
  element = (ox_element("mo") << "&#x2062;")
310
- element.attributes[:rspace] = "thickmathspace" if attributes
303
+ element.attributes[:rspace] = "thickmathspace" if text_in_tag?(node.nodes)
311
304
  element
312
305
  end
313
306
 
@@ -327,6 +320,17 @@ module Plurimath
327
320
  def unicodemath_value
328
321
  (negated_value? || mini_sized?) ? value&.map(&:to_unicodemath)&.join : value&.map(&:to_unicodemath)&.join(" ")
329
322
  end
323
+
324
+ def valid_previous?(previous)
325
+ return unless previous
326
+
327
+ ["mi", "mn"].include?(previous.name) ||
328
+ inside_tag?(previous)
329
+ end
330
+
331
+ def inside_tag?(previous)
332
+ previous&.nodes&.any? { |node| valid_previous?(node) if node.is_a?(Ox::Element) }
333
+ end
330
334
  end
331
335
  end
332
336
  end
@@ -191,8 +191,12 @@ module Plurimath
191
191
  elsif flatten_mrow&.first&.is_nary_function? && flatten_mrow.length == 2
192
192
  nary_function = flatten_mrow.first
193
193
  if nary_function.is_ternary_function? && nary_function.all_values_exist?
194
- flatten_mrow[0] = nary_function.new_nary_function(flatten_mrow.delete_at(1))
195
- flatten_mrow
194
+ if nary_function.respond_to?(:new_nary_function)
195
+ flatten_mrow[0] = nary_function.new_nary_function(flatten_mrow.delete_at(1))
196
+ flatten_mrow
197
+ else
198
+ Utility.filter_values(flatten_mrow)
199
+ end
196
200
  elsif nary_function.is_binary_function? && nary_function.any_value_exist?
197
201
  flatten_mrow[0] = nary_function.new_nary_function(flatten_mrow.delete_at(1))
198
202
  flatten_mrow
@@ -998,17 +998,16 @@ module Plurimath
998
998
  pprime: "&#x2033;",
999
999
  prime: "&#x2032;",
1000
1000
  }.freeze
1001
+
1001
1002
  PARENTHESIS_MATRICES = {
1002
- multline: nil,
1003
- Vmatrix: "norm[",
1004
- vmatrix: "|",
1005
1003
  pmatrix: "(",
1006
- Bmatrix: "{",
1004
+ vmatrix: "|",
1005
+ Vmatrix: "norm[",
1007
1006
  bmatrix: "[",
1007
+ Bmatrix: "{",
1008
+ eqarray: nil,
1008
1009
  matrix: nil,
1009
- split: nil,
1010
- align: nil,
1011
- array: nil,
1010
+ cases: nil,
1012
1011
  }.freeze
1013
1012
  end
1014
1013
  end
@@ -7,7 +7,7 @@ module Plurimath
7
7
 
8
8
  def initialize(text)
9
9
  @text = text
10
- raise Math::ParseError.new(error_message) if text.match?(/\^(([^\s].*?[a-z]+)|(\([^-\d]+\)|[^\(\d-]+))/)
10
+ raise Math::ParseError.new(error_message) if text.match?(/\^(([^\s][^*\/,"]*?[a-z]+)|(\([^-\d]+\)|[^\(\d-]+))/)
11
11
  end
12
12
 
13
13
  def to_formula
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plurimath
4
- VERSION = "0.8.0"
4
+ VERSION = "0.8.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plurimath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-08 00:00:00.000000000 Z
11
+ date: 2024-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -60,6 +60,8 @@ files:
60
60
  - MathML-Supported-Data.adoc
61
61
  - README.adoc
62
62
  - Rakefile
63
+ - UnicodeMath-Supported-Data.adoc
64
+ - UnitsML-Supported-Data.adoc
63
65
  - bin/console
64
66
  - bin/setup
65
67
  - lib/plurimath.rb