plurimath 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec-opal +1 -1
  3. data/.rubocop.yml +9 -5
  4. data/.rubocop_todo.yml +0 -0
  5. data/Gemfile +7 -5
  6. data/README.adoc +57 -1
  7. data/Rakefile +11 -0
  8. data/lib/plurimath/asciimath/parse.rb +0 -1
  9. data/lib/plurimath/asciimath/parser.rb +0 -3
  10. data/lib/plurimath/asciimath.rb +5 -0
  11. data/lib/plurimath/cli.rb +28 -1
  12. data/lib/plurimath/errors.rb +0 -4
  13. data/lib/plurimath/formatter/numbers.rb +12 -0
  14. data/lib/plurimath/formatter/numeric_formatter.rb +4 -1
  15. data/lib/plurimath/formatter/standard.rb +0 -1
  16. data/lib/plurimath/formatter.rb +6 -9
  17. data/lib/plurimath/html/parse.rb +0 -1
  18. data/lib/plurimath/html/parser.rb +0 -3
  19. data/lib/plurimath/html.rb +5 -0
  20. data/lib/plurimath/latex/parse.rb +0 -1
  21. data/lib/plurimath/latex/parser.rb +2 -5
  22. data/lib/plurimath/latex.rb +5 -0
  23. data/lib/plurimath/math/core.rb +6 -2
  24. data/lib/plurimath/math/formula/mrow.rb +2 -41
  25. data/lib/plurimath/math/formula/mstyle.rb +6 -0
  26. data/lib/plurimath/math/formula.rb +59 -301
  27. data/lib/plurimath/math/function/abs.rb +0 -1
  28. data/lib/plurimath/math/function/arccos.rb +0 -1
  29. data/lib/plurimath/math/function/arcsin.rb +0 -1
  30. data/lib/plurimath/math/function/arctan.rb +0 -1
  31. data/lib/plurimath/math/function/arg.rb +0 -1
  32. data/lib/plurimath/math/function/bar.rb +0 -1
  33. data/lib/plurimath/math/function/base.rb +0 -3
  34. data/lib/plurimath/math/function/binary_function.rb +5 -3
  35. data/lib/plurimath/math/function/cancel.rb +0 -1
  36. data/lib/plurimath/math/function/ceil.rb +0 -1
  37. data/lib/plurimath/math/function/color.rb +0 -1
  38. data/lib/plurimath/math/function/cos.rb +0 -1
  39. data/lib/plurimath/math/function/cosh.rb +0 -1
  40. data/lib/plurimath/math/function/cot.rb +0 -1
  41. data/lib/plurimath/math/function/coth.rb +0 -1
  42. data/lib/plurimath/math/function/csc.rb +0 -1
  43. data/lib/plurimath/math/function/csch.rb +0 -1
  44. data/lib/plurimath/math/function/ddot.rb +0 -1
  45. data/lib/plurimath/math/function/deg.rb +0 -1
  46. data/lib/plurimath/math/function/det.rb +0 -1
  47. data/lib/plurimath/math/function/dim.rb +0 -1
  48. data/lib/plurimath/math/function/dot.rb +0 -1
  49. data/lib/plurimath/math/function/exp.rb +0 -1
  50. data/lib/plurimath/math/function/fenced.rb +1 -197
  51. data/lib/plurimath/math/function/floor.rb +0 -1
  52. data/lib/plurimath/math/function/font_style/bold-fraktur.rb +0 -1
  53. data/lib/plurimath/math/function/font_style/bold-italic.rb +0 -1
  54. data/lib/plurimath/math/function/font_style/bold-sans-serif.rb +0 -1
  55. data/lib/plurimath/math/function/font_style/bold-script.rb +0 -1
  56. data/lib/plurimath/math/function/font_style/bold.rb +0 -1
  57. data/lib/plurimath/math/function/font_style/double_struck.rb +0 -1
  58. data/lib/plurimath/math/function/font_style/fraktur.rb +0 -1
  59. data/lib/plurimath/math/function/font_style/italic.rb +0 -1
  60. data/lib/plurimath/math/function/font_style/monospace.rb +0 -1
  61. data/lib/plurimath/math/function/font_style/normal.rb +0 -1
  62. data/lib/plurimath/math/function/font_style/sans-serif-bold-italic.rb +0 -1
  63. data/lib/plurimath/math/function/font_style/sans-serif-italic.rb +0 -1
  64. data/lib/plurimath/math/function/font_style/sans-serif.rb +0 -1
  65. data/lib/plurimath/math/function/font_style/script.rb +0 -1
  66. data/lib/plurimath/math/function/font_style.rb +29 -2
  67. data/lib/plurimath/math/function/frac.rb +0 -3
  68. data/lib/plurimath/math/function/gcd.rb +0 -1
  69. data/lib/plurimath/math/function/glb.rb +0 -1
  70. data/lib/plurimath/math/function/hat.rb +0 -1
  71. data/lib/plurimath/math/function/hom.rb +0 -1
  72. data/lib/plurimath/math/function/inf.rb +1 -2
  73. data/lib/plurimath/math/function/int.rb +2 -3
  74. data/lib/plurimath/math/function/intent.rb +0 -1
  75. data/lib/plurimath/math/function/ker.rb +0 -1
  76. data/lib/plurimath/math/function/lcm.rb +0 -1
  77. data/lib/plurimath/math/function/left.rb +0 -1
  78. data/lib/plurimath/math/function/lg.rb +0 -1
  79. data/lib/plurimath/math/function/lim.rb +1 -2
  80. data/lib/plurimath/math/function/liminf.rb +0 -1
  81. data/lib/plurimath/math/function/limits.rb +0 -1
  82. data/lib/plurimath/math/function/limsup.rb +0 -1
  83. data/lib/plurimath/math/function/linebreak.rb +0 -1
  84. data/lib/plurimath/math/function/ln.rb +0 -1
  85. data/lib/plurimath/math/function/log.rb +1 -2
  86. data/lib/plurimath/math/function/longdiv.rb +0 -3
  87. data/lib/plurimath/math/function/lub.rb +0 -1
  88. data/lib/plurimath/math/function/max.rb +0 -1
  89. data/lib/plurimath/math/function/mbox.rb +0 -1
  90. data/lib/plurimath/math/function/menclose.rb +0 -3
  91. data/lib/plurimath/math/function/merror.rb +0 -3
  92. data/lib/plurimath/math/function/mglyph.rb +0 -3
  93. data/lib/plurimath/math/function/min.rb +0 -1
  94. data/lib/plurimath/math/function/mlabeledtr.rb +0 -20
  95. data/lib/plurimath/math/function/mod.rb +0 -1
  96. data/lib/plurimath/math/function/mpadded.rb +0 -3
  97. data/lib/plurimath/math/function/ms.rb +1 -77
  98. data/lib/plurimath/math/function/msgroup.rb +0 -27
  99. data/lib/plurimath/math/function/msline.rb +0 -3
  100. data/lib/plurimath/math/function/multiscript.rb +0 -14
  101. data/lib/plurimath/math/function/nary.rb +4 -0
  102. data/lib/plurimath/math/function/none.rb +1 -4
  103. data/lib/plurimath/math/function/norm.rb +0 -1
  104. data/lib/plurimath/math/function/obrace.rb +0 -1
  105. data/lib/plurimath/math/function/oint.rb +2 -3
  106. data/lib/plurimath/math/function/over.rb +0 -3
  107. data/lib/plurimath/math/function/overset.rb +3 -3
  108. data/lib/plurimath/math/function/phantom.rb +0 -3
  109. data/lib/plurimath/math/function/power.rb +0 -3
  110. data/lib/plurimath/math/function/power_base.rb +0 -3
  111. data/lib/plurimath/math/function/prod.rb +2 -3
  112. data/lib/plurimath/math/function/right.rb +0 -1
  113. data/lib/plurimath/math/function/root.rb +0 -3
  114. data/lib/plurimath/math/function/rule.rb +0 -1
  115. data/lib/plurimath/math/function/scarries.rb +0 -3
  116. data/lib/plurimath/math/function/scarry.rb +22 -0
  117. data/lib/plurimath/math/function/sec.rb +0 -1
  118. data/lib/plurimath/math/function/sech.rb +0 -1
  119. data/lib/plurimath/math/function/semantics.rb +0 -15
  120. data/lib/plurimath/math/function/sin.rb +0 -1
  121. data/lib/plurimath/math/function/sinh.rb +0 -1
  122. data/lib/plurimath/math/function/sqrt.rb +0 -3
  123. data/lib/plurimath/math/function/stackrel.rb +0 -3
  124. data/lib/plurimath/math/function/substack.rb +0 -1
  125. data/lib/plurimath/math/function/sum.rb +2 -3
  126. data/lib/plurimath/math/function/sup.rb +0 -1
  127. data/lib/plurimath/math/function/table/align.rb +0 -1
  128. data/lib/plurimath/math/function/table/array.rb +0 -1
  129. data/lib/plurimath/math/function/table/bmatrix.rb +0 -1
  130. data/lib/plurimath/math/function/table/cases.rb +0 -1
  131. data/lib/plurimath/math/function/table/eqarray.rb +0 -1
  132. data/lib/plurimath/math/function/table/matrix.rb +0 -1
  133. data/lib/plurimath/math/function/table/multline.rb +0 -1
  134. data/lib/plurimath/math/function/table/pmatrix.rb +0 -1
  135. data/lib/plurimath/math/function/table/split.rb +0 -1
  136. data/lib/plurimath/math/function/table/vmatrix.rb +0 -1
  137. data/lib/plurimath/math/function/table.rb +10 -23
  138. data/lib/plurimath/math/function/tan.rb +0 -1
  139. data/lib/plurimath/math/function/tanh.rb +0 -1
  140. data/lib/plurimath/math/function/td.rb +0 -4
  141. data/lib/plurimath/math/function/ternary_function.rb +6 -2
  142. data/lib/plurimath/math/function/text.rb +1 -6
  143. data/lib/plurimath/math/function/tilde.rb +4 -1
  144. data/lib/plurimath/math/function/tr.rb +0 -13
  145. data/lib/plurimath/math/function/ubrace.rb +0 -1
  146. data/lib/plurimath/math/function/ul.rb +4 -1
  147. data/lib/plurimath/math/function/underover.rb +0 -3
  148. data/lib/plurimath/math/function/underset.rb +22 -45
  149. data/lib/plurimath/math/function/unitsml.rb +2 -1
  150. data/lib/plurimath/math/function/vec.rb +4 -1
  151. data/lib/plurimath/math/function.rb +107 -10
  152. data/lib/plurimath/math/number.rb +9 -7
  153. data/lib/plurimath/math/symbols/comma.rb +1 -1
  154. data/lib/plurimath/math/symbols/plus.rb +1 -1
  155. data/lib/plurimath/math/symbols/symbol.rb +17 -4
  156. data/lib/plurimath/math.rb +8 -26
  157. data/lib/plurimath/mathml/constants.rb +1 -0
  158. data/lib/plurimath/mathml/formula_transformation.rb +442 -0
  159. data/lib/plurimath/mathml/parser.rb +11 -50
  160. data/lib/plurimath/mathml/translator.rb +584 -0
  161. data/lib/plurimath/mathml/utility/formula_transformation.rb +2 -341
  162. data/lib/plurimath/mathml.rb +5 -0
  163. data/lib/plurimath/number_formatter.rb +2 -1
  164. data/lib/plurimath/omml/parser.rb +10 -7
  165. data/lib/plurimath/omml/transform.rb +17 -5
  166. data/lib/plurimath/omml.rb +3 -0
  167. data/lib/plurimath/setup/opal.rb.erb +3 -4
  168. data/lib/plurimath/unicode_math/parse.rb +0 -5
  169. data/lib/plurimath/unicode_math/parser.rb +1 -6
  170. data/lib/plurimath/unicode_math/parsing_rules/absence_rules.rb +0 -1
  171. data/lib/plurimath/unicode_math/parsing_rules/common_rules.rb +0 -1
  172. data/lib/plurimath/unicode_math/parsing_rules/constants_rules.rb +0 -1
  173. data/lib/plurimath/unicode_math/parsing_rules/masked.rb +0 -1
  174. data/lib/plurimath/unicode_math/parsing_rules/sub_sup.rb +0 -1
  175. data/lib/plurimath/unicode_math/parsing_rules.rb +14 -0
  176. data/lib/plurimath/unicode_math.rb +6 -0
  177. data/lib/plurimath/utility.rb +1 -1
  178. data/lib/plurimath/version.rb +1 -1
  179. data/lib/plurimath/xml_engine/oga.rb +6 -6
  180. data/lib/plurimath/xml_engine/ox_engine.rb +2 -2
  181. data/lib/plurimath/xml_engine.rb +2 -0
  182. data/lib/plurimath.rb +43 -18
  183. data/plurimath.gemspec +5 -4
  184. metadata +33 -15
  185. data/lib/plurimath/mathml/utility/empty_defined_methods.rb +0 -483
  186. data/lib/plurimath/mathml/utility.rb +0 -369
@@ -1,13 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "ternary_function"
4
- require_relative "../../mathml/utility"
5
3
 
6
4
  module Plurimath
7
5
  module Math
8
6
  module Function
9
7
  class Fenced < TernaryFunction
10
- include Mathml::Utility
8
+ include Mathml::FormulaTransformation
11
9
 
12
10
  attr_accessor :options
13
11
 
@@ -166,13 +164,6 @@ module Plurimath
166
164
  @options[:separators] = value
167
165
  end
168
166
 
169
- def content=(value)
170
- if parens_nil?
171
- @parameter_one = Math::Symbols::Paren::Lround.new
172
- @parameter_three = Math::Symbols::Paren::Rround.new
173
- end
174
- end
175
-
176
167
  def open=(value)
177
168
  return unless value
178
169
 
@@ -185,195 +176,8 @@ module Plurimath
185
176
  @parameter_three = validate_symbols(value)
186
177
  end
187
178
 
188
- def element_order=(value)
189
- @parameter_two = validated_order(value&.map(&:name))
190
- end
191
-
192
- def mi_value=(value)
193
- return if value.nil? || value.empty?
194
-
195
- update(
196
- replace_order_with_value(
197
- @parameter_two,
198
- Array(validate_symbols(value)),
199
- "mi"
200
- )
201
- )
202
- end
203
-
204
- def mn_value=(value)
205
- return if value.nil? || value.empty?
206
-
207
- update(
208
- replace_order_with_value(
209
- @parameter_two,
210
- Array(validate_symbols(value)),
211
- "mn"
212
- )
213
- )
214
- end
215
-
216
- def mtext_value=(value)
217
- return if value.nil? || value.empty?
218
-
219
- update(
220
- replace_order_with_value(
221
- @parameter_two,
222
- Array(validate_symbols(value)),
223
- "mtext"
224
- )
225
- )
226
- end
227
-
228
- def mo_value=(value)
229
- return if value.nil? || value.empty?
230
-
231
- update(
232
- replace_order_with_value(
233
- @parameter_two,
234
- Array(validate_symbols(value)),
235
- "mo"
236
- )
237
- )
238
- end
239
-
240
- def mstyle_value=(value)
241
- return if value.nil? || value.empty?
242
-
243
- update(
244
- replace_order_with_value(
245
- @parameter_two,
246
- Array(value),
247
- "mstyle"
248
- )
249
- )
250
- end
251
-
252
- def munderover_value=(value)
253
- update_temp_order(value, "munderover")
254
- end
255
-
256
- def msub_value=(value)
257
- update_temp_order(value, "msub")
258
- end
259
-
260
- def msup_value=(value)
261
- update_temp_order(value, "msup")
262
- end
263
-
264
- def mover_value=(value)
265
- update_temp_order(value, "mover")
266
- end
267
-
268
- def munder_value=(value)
269
- update_temp_order(value, "munder")
270
- end
271
-
272
- def msubsup_value=(value)
273
- update_temp_order(value, "msubsup")
274
- end
275
-
276
- def mfrac_value=(value)
277
- update_temp_order(value, "mfrac")
278
- end
279
-
280
- def msqrt_value=(value)
281
- update_temp_order(value, "msqrt")
282
- end
283
-
284
- def mfenced_value=(value)
285
- update_temp_order(value, "mfenced")
286
- end
287
-
288
- def mtable_value=(value)
289
- return if value.nil? || value.empty?
290
-
291
- update(
292
- replace_order_with_value(
293
- Array(@parameter_two),
294
- update_temp_mathml_values(value),
295
- "mtable"
296
- )
297
- )
298
- end
299
-
300
- def mrow_value=(value)
301
- return if value.nil? || value.empty?
302
-
303
- update(
304
- replace_order_with_value(
305
- Array(@parameter_two),
306
- update_temp_mathml_values(
307
- Array(filter_values(value, array_to_instance: true))
308
- ),
309
- "mrow"
310
- )
311
- )
312
- end
313
-
314
- def mspace_value=(value)
315
- return if value.nil? || value.empty?
316
-
317
- if value.first.linebreak
318
- linebreak = Math::Function::Linebreak.new(
319
- nil,
320
- { linebreak: value.first.linebreak }
321
- )
322
-
323
- update(
324
- replace_order_with_value(
325
- Array(@parameter_two),
326
- [linebreak],
327
- "mspace"
328
- )
329
- )
330
- else
331
- @parameter_two&.delete("mspace")
332
- end
333
- end
334
-
335
- def mpadded_value=(value)
336
- update_temp_order(value, "mpadded")
337
- end
338
-
339
- def mfraction_value=(value)
340
- update_temp_order(value, "mfraction")
341
- end
342
-
343
- def mmultiscripts_value=(value)
344
- update_temp_order(value, "mmultiscripts")
345
- end
346
-
347
- def mphantom_value=(value)
348
- update_temp_order(value, "mphantom")
349
- end
350
-
351
179
  protected
352
180
 
353
- def update_temp_order(value, order_name)
354
- return if value.nil? || value.empty?
355
-
356
- update(
357
- replace_order_with_value(
358
- Array(@parameter_two),
359
- update_temp_mathml_values(value),
360
- order_name
361
- )
362
- )
363
- end
364
-
365
- def remove_order(order)
366
- @parameter_two.delete_if { |val| val.is_a?(String) && val == order }
367
- end
368
-
369
- def insert(values)
370
- update(Array(@parameter_two) + values)
371
- end
372
-
373
- def update(object)
374
- @parameter_two = Array(object)
375
- end
376
-
377
181
  def open_paren(dpr, options:)
378
182
  first_value = symbol_or_paren(parameter_one, lang: :omml, options: options)
379
183
  return dpr if first_value.nil?
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../font_style"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,15 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "binary_function"
4
-
5
3
  module Plurimath
6
4
  module Math
7
5
  module Function
8
6
  class FontStyle < BinaryFunction
7
+ autoload :Bold, "#{__dir__}/font_style/bold"
8
+ autoload :BoldFraktur, "#{__dir__}/font_style/bold-fraktur"
9
+ autoload :BoldItalic, "#{__dir__}/font_style/bold-italic"
10
+ autoload :BoldSansSerif, "#{__dir__}/font_style/bold-sans-serif"
11
+ autoload :BoldScript, "#{__dir__}/font_style/bold-script"
12
+ autoload :DoubleStruck, "#{__dir__}/font_style/double_struck"
13
+ autoload :Fraktur, "#{__dir__}/font_style/fraktur"
14
+ autoload :Italic, "#{__dir__}/font_style/italic"
15
+ autoload :Monospace, "#{__dir__}/font_style/monospace"
16
+ autoload :Normal, "#{__dir__}/font_style/normal"
17
+ autoload :SansSerif, "#{__dir__}/font_style/sans-serif"
18
+ autoload :SansSerifBoldItalic, "#{__dir__}/font_style/sans-serif-bold-italic"
19
+ autoload :SansSerifItalic, "#{__dir__}/font_style/sans-serif-italic"
20
+ autoload :Script, "#{__dir__}/font_style/script"
21
+
9
22
  def to_asciimath(options:)
10
23
  parameter_one&.to_asciimath(options: options)
11
24
  end
12
25
 
26
+ def ==(object)
27
+ object.class == self.class &&
28
+ object.parameter_one == parameter_one &&
29
+ comparable_font_family(object.parameter_two) == comparable_font_family(parameter_two)
30
+ end
31
+
13
32
  def to_mathml_without_math_tag(intent, options:)
14
33
  first_value = parameter_one&.to_mathml_without_math_tag(intent, options: options)
15
34
  Utility.update_nodes(
@@ -205,6 +224,14 @@ module Plurimath
205
224
  )
206
225
  end
207
226
 
227
+ private
228
+
229
+ def comparable_font_family(value)
230
+ return if value.nil?
231
+
232
+ Utility::FONT_STYLES[value.to_sym] || value
233
+ end
234
+
208
235
  def font_classes(object = self)
209
236
  Utility::FONT_STYLES.select { |_font, font_class| font_class == object.class }.keys.map(&:to_s)
210
237
  end
@@ -1,13 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "binary_function"
4
- require_relative "../../mathml/utility"
5
3
 
6
4
  module Plurimath
7
5
  module Math
8
6
  module Function
9
7
  class Frac < BinaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  attr_accessor :options
13
10
 
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "binary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -20,7 +19,7 @@ module Plurimath
20
19
 
21
20
  def to_mathml_without_math_tag(intent, options:)
22
21
  first_value = Utility.ox_element("mo") << class_name
23
- return first_value unless all_values_exist?
22
+ return first_value unless any_value_exist?
24
23
 
25
24
  tag_name = if parameter_two && parameter_one
26
25
  "underover"
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "ternary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -40,7 +39,7 @@ module Plurimath
40
39
 
41
40
  def to_mathml_without_math_tag(intent, options:)
42
41
  base_element = (Utility.ox_element("mo") << invert_unicode_symbols.to_s)
43
- return base_element unless all_values_exist?
42
+ return base_element unless any_value_exist?
44
43
 
45
44
  msubsup_tag = Utility.ox_element("msubsup")
46
45
  Utility.update_nodes(
@@ -66,7 +65,7 @@ module Plurimath
66
65
  end
67
66
 
68
67
  def to_omml_without_math_tag(display_style, options:)
69
- if all_values_exist?
68
+ if any_value_exist?
70
69
  nary = Utility.ox_element("nary", namespace: "m")
71
70
  Utility.update_nodes(nary, nary_array(display_style, options: options))
72
71
  [nary]
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "binary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "binary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -26,7 +25,7 @@ module Plurimath
26
25
 
27
26
  def to_mathml_without_math_tag(intent, options:)
28
27
  first_value = Utility.ox_element("mo") << "lim"
29
- return first_value unless all_values_exist?
28
+ return first_value unless any_value_exist?
30
29
 
31
30
  tag_name = if parameter_two && parameter_one
32
31
  "underover"
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "ternary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "binary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -31,7 +30,7 @@ module Plurimath
31
30
  end
32
31
 
33
32
  def to_omml_without_math_tag(display_style, options:)
34
- return r_element("log", rpr_tag: false) unless all_values_exist?
33
+ return r_element("log", rpr_tag: false) unless any_value_exist?
35
34
 
36
35
  ssubsup = Utility.ox_element("sSubSup", namespace: "m")
37
36
  ssubsuppr = Utility.ox_element("sSubSupPr", namespace: "m")
@@ -1,13 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
- require_relative "../../mathml/utility"
5
3
 
6
4
  module Plurimath
7
5
  module Math
8
6
  module Function
9
7
  class Longdiv < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  def to_asciimath(options:)
13
10
  asciimath_value(options: options)
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
3
  module Plurimath
5
4
  module Math
6
5
  module Function
@@ -1,13 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "binary_function"
4
- require_relative "../../mathml/utility"
5
3
 
6
4
  module Plurimath
7
5
  module Math
8
6
  module Function
9
7
  class Menclose < BinaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  FUNCTION = {
13
10
  name: "enclosure",
@@ -1,13 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "unary_function"
4
- require_relative "../../mathml/utility"
5
3
 
6
4
  module Plurimath
7
5
  module Math
8
6
  module Function
9
7
  class Merror < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  def to_asciimath(**); end
13
10