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,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 Mglyph < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  def initialize(parameter_one = {})
13
10
  super(parameter_one)
@@ -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,14 +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 Mlabeledtr < BinaryFunction
10
- include Mathml::Utility
11
-
12
8
  def to_mathml_without_math_tag(intent, options:)
13
9
  table = ox_element("mtable")
14
10
  mlabeledtr = ox_element(class_name)
@@ -21,22 +17,6 @@ module Plurimath
21
17
  "#{parameter_one&.to_unicodemath(options: options)}##{parameter_two&.value}"
22
18
  end
23
19
 
24
- def id=(value)
25
- return if value.nil?
26
-
27
- @parameter_two = Text.new(value)
28
- end
29
-
30
- def mtd_value=(value)
31
- return if value.nil? || value.empty?
32
-
33
- self.parameter_one = replace_order_with_value(
34
- clear_temp_order,
35
- update_temp_mathml_values(value),
36
- "mtd"
37
- )
38
- end
39
-
40
20
  protected
41
21
 
42
22
  def labeledtr_td(tr, value)
@@ -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,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 Mpadded < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  attr_accessor :options
13
10
 
@@ -1,14 +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 Ms < UnaryFunction
10
- include Mathml::Utility
11
-
12
8
  def to_mathml_without_math_tag(intent, **)
13
9
  Utility.ox_element("ms") << parameter_one
14
10
  end
@@ -36,79 +32,7 @@ module Plurimath
36
32
  end
37
33
 
38
34
  def value=(content)
39
- temp_content = updated_temp_mathml_values.flatten.map(&:to_ms_value)
40
- @parameter_one = [
41
- temp_content,
42
- content&.empty? ? nil : content,
43
- ].flatten.compact.join(" ")
44
- end
45
-
46
- def mi_value=(value)
47
- return if value.nil?
48
-
49
- @temp_mathml_order = replace_order_with_value(
50
- @temp_mathml_order,
51
- value,
52
- "mi"
53
- )
54
- end
55
-
56
- def mn_value=(value)
57
- return if value.nil?
58
-
59
- @temp_mathml_order = replace_order_with_value(
60
- @temp_mathml_order,
61
- value,
62
- "mn"
63
- )
64
- end
65
-
66
- def mo_value=(value)
67
- return if value.nil?
68
-
69
- @temp_mathml_order = replace_order_with_value(
70
- @temp_mathml_order,
71
- value,
72
- "mo"
73
- )
74
- end
75
-
76
- def msub_value=(value)
77
- return if value.nil?
78
-
79
- @temp_mathml_order = replace_order_with_value(
80
- @temp_mathml_order,
81
- value,
82
- "msub"
83
- )
84
- end
85
-
86
- def msup_value=(value)
87
- return if value.nil?
88
-
89
- @temp_mathml_order = replace_order_with_value(
90
- @temp_mathml_order,
91
- value,
92
- "msup"
93
- )
94
- end
95
-
96
- def msubsup_value=(value)
97
- return if value.nil?
98
-
99
- @temp_mathml_order = replace_order_with_value(
100
- @temp_mathml_order,
101
- value,
102
- "msubsup"
103
- )
104
- end
105
-
106
- def updated_temp_mathml_values
107
- @temp_mathml_order.map do |element|
108
- next element if element.is_a?(Math::Symbols::Symbol)
109
-
110
- update_temp_mathml_values([element])
111
- end
35
+ @parameter_one = content.is_a?(Array) ? content.join(" ") : content
112
36
  end
113
37
  end
114
38
  end
@@ -1,14 +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 Msgroup < UnaryFunction
10
- include Mathml::Utility
11
-
12
8
  def to_asciimath(options:)
13
9
  parameter_one.map { |param| param.to_asciimath(options: options) }.join
14
10
  end
@@ -75,30 +71,7 @@ module Plurimath
75
71
  custom_array_line_breaking(obj)
76
72
  end
77
73
 
78
- def msgroup_text; end
79
-
80
- def msgroup_text=(value)
81
- return if empty_value?(value)
82
-
83
- if value.is_a?(Array)
84
- @temp_mathml_order << Text.new(value.pop)
85
- else
86
- @temp_mathml_order << Text.new(value)
87
- end
88
- end
89
-
90
74
  private
91
-
92
- def empty_value?(value)
93
- case value
94
- when String
95
- value.strip.empty?
96
- when Array
97
- value.none? { |element| element.match?(/[\S]/) }
98
- when NilClass
99
- true
100
- end
101
- end
102
75
  end
103
76
  end
104
77
  end
@@ -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 Msline < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  def to_asciimath(**); end
13
10
 
@@ -1,14 +1,10 @@
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 Multiscript < TernaryFunction
10
- include Mathml::Utility
11
-
12
8
  FUNCTION = {
13
9
  name: "multiscript",
14
10
  first_value: "base",
@@ -83,16 +79,6 @@ module Plurimath
83
79
  end
84
80
  end
85
81
 
86
- def none_value=(value)
87
- return if value.nil? || value.empty?
88
-
89
- @temp_mathml_order = replace_order_with_value(
90
- @temp_mathml_order,
91
- value,
92
- "none"
93
- )
94
- end
95
-
96
82
  private
97
83
 
98
84
  def prescripts
@@ -135,6 +135,10 @@ module Plurimath
135
135
  end
136
136
  end
137
137
 
138
+ def is_nary_function?
139
+ true
140
+ end
141
+
138
142
  protected
139
143
 
140
144
  def chr_value(narypr, options:)
@@ -1,20 +1,17 @@
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 None < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  def to_asciimath(**); end
13
10
 
14
11
  def to_latex(**); end
15
12
 
16
13
  def to_mathml_without_math_tag(_, **)
17
- ox_element("none")
14
+ Utility.ox_element("none")
18
15
  end
19
16
 
20
17
  def to_omml_without_math_tag(_, **)
@@ -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 "ternary_function"
4
3
 
5
4
  module Plurimath
6
5
  module Math
@@ -40,7 +39,7 @@ module Plurimath
40
39
  def to_mathml_without_math_tag(intent, options:)
41
40
  mo_tag = ox_element("mo")
42
41
  mo_tag << invert_unicode_symbols.to_s unless hide_function_name
43
- return mo_tag unless all_values_exist?
42
+ return mo_tag unless any_value_exist?
44
43
 
45
44
  tag_name = if parameter_one && parameter_two
46
45
  "subsup"
@@ -71,7 +70,7 @@ module Plurimath
71
70
  end
72
71
 
73
72
  def to_omml_without_math_tag(display_style, options:)
74
- if all_values_exist?
73
+ if any_value_exist?
75
74
  nary = Utility.ox_element("nary", namespace: "m")
76
75
  Utility.update_nodes(
77
76
  nary,
@@ -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 Over < BinaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  FUNCTION = {
13
10
  name: "over",
@@ -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 Overset < BinaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  attr_accessor :options
13
10
 
@@ -49,6 +46,9 @@ module Plurimath
49
46
  limupp,
50
47
  [
51
48
  limupppr,
49
+ # Overset preserves Plurimath's source argument order across
50
+ # formats; OMML uses this mapping to avoid remapping fields during
51
+ # MathML/UnicodeMath/OMML round-trips.
52
52
  omml_parameter(parameter_one, display_style, tag_name: "e", options: options),
53
53
  omml_parameter(parameter_two, display_style, tag_name: "lim", options: options),
54
54
  ],
@@ -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 Phantom < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  def to_asciimath(options:)
13
10
  "#{Array.new(asciimath_value(options: options)&.length, '\ ').join}"
@@ -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 Power < BinaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  FUNCTION = {
13
10
  name: "superscript",
@@ -1,13 +1,10 @@
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 PowerBase < TernaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  FUNCTION = {
13
10
  name: "subsup",
@@ -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
  def to_mathml_without_math_tag(intent, options:)
41
40
  first_value = ox_element("mo")
42
41
  first_value << invert_unicode_symbols.to_s unless hide_function_name
43
- return first_value unless all_values_exist?
42
+ return first_value unless any_value_exist?
44
43
 
45
44
  munderover_tag = Utility.update_nodes(
46
45
  prod_tag_name,
@@ -70,7 +69,7 @@ module Plurimath
70
69
  end
71
70
 
72
71
  def to_omml_without_math_tag(display_style, options:)
73
- return r_element("&#x220f;", rpr_tag: false) unless all_values_exist?
72
+ return r_element("&#x220f;", rpr_tag: false) unless any_value_exist?
74
73
 
75
74
  nary = Utility.ox_element("nary", namespace: "m")
76
75
  Utility.update_nodes(nary, nary_values(display_style, 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,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 Root < BinaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  FUNCTION = {
13
10
  name: "root",
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "ternary_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 "unary_function"
4
- require_relative "../../mathml/utility"
5
3
 
6
4
  module Plurimath
7
5
  module Math
8
6
  module Function
9
7
  class Scarries < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  def to_asciimath(options:)
13
10
  asciimath_value(options: options)
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+
4
+ module Plurimath
5
+ module Math
6
+ module Function
7
+ class Scarry < UnaryFunction
8
+ def to_asciimath(**); end
9
+
10
+ def to_latex(**); end
11
+
12
+ def to_mathml_without_math_tag(_, **)
13
+ ox_element("none")
14
+ end
15
+
16
+ def to_omml_without_math_tag(_, **); end
17
+
18
+ def to_unicodemath(**); end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -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,14 +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 Semantics < BinaryFunction
10
- include Mathml::Utility
11
-
12
8
  FUNCTION = {
13
9
  name: "semantics",
14
10
  first_value: "first argument",
@@ -44,17 +40,6 @@ module Plurimath
44
40
  end
45
41
  end
46
42
 
47
- def annotation=(value)
48
- return unless value
49
-
50
- @parameter_two = [
51
- {
52
- annotation: value,
53
- }
54
- ]
55
- @temp_mathml_order.delete("annotation")
56
- end
57
-
58
43
  protected
59
44
 
60
45
  def other_tags(array, intent, 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,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 Sqrt < UnaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  attr_accessor :options
13
10
 
@@ -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 Stackrel < BinaryFunction
10
- include Mathml::Utility
11
8
 
12
9
  FUNCTION = {
13
10
  name: "stackrel",
@@ -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
@@ -41,7 +40,7 @@ module Plurimath
41
40
  def to_mathml_without_math_tag(intent, options:)
42
41
  first_value = ox_element("mo")
43
42
  first_value << invert_unicode_symbols.to_s unless hide_function_name
44
- return first_value unless all_values_exist?
43
+ return first_value unless any_value_exist?
45
44
 
46
45
  munderover_tag = Utility.update_nodes(
47
46
  sum_tag,
@@ -78,7 +77,7 @@ module Plurimath
78
77
  end
79
78
 
80
79
  def to_omml_without_math_tag(display_style, options:)
81
- return r_element("&#x2211;", rpr_tag: false) unless all_values_exist?
80
+ return r_element("&#x2211;", rpr_tag: false) unless any_value_exist?
82
81
 
83
82
  nary = Utility.ox_element("nary", namespace: "m")
84
83
  Utility.update_nodes(
@@ -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 "../table"
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 "../table"
4
3
 
5
4
  module Plurimath
6
5
  module Math