asciimath2unitsml 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +2 -23
- data/.hound.yml +5 -0
- data/.rubocop.yml +3 -7
- data/Gemfile +1 -1
- data/Rakefile +1 -1
- data/asciimath2unitsml.gemspec +13 -16
- data/bin/rspec +1 -2
- data/lib/asciimath2unitsml.rb +0 -1
- data/lib/asciimath2unitsml/conv.rb +13 -13
- data/lib/asciimath2unitsml/parse.rb +27 -15
- data/lib/asciimath2unitsml/render.rb +22 -16
- data/lib/asciimath2unitsml/unit.rb +21 -17
- data/lib/asciimath2unitsml/validate.rb +14 -14
- data/lib/asciimath2unitsml/version.rb +1 -1
- data/lib/unitsdb_ruby/unitsdb.rb +21 -11
- data/spec/conv_spec.rb +1232 -1230
- data/spec/spec_helper.rb +10 -10
- metadata +19 -18
@@ -12,14 +12,14 @@ module Asciimath2UnitsML
|
|
12
12
|
hash
|
13
13
|
end
|
14
14
|
|
15
|
-
def validate_unit(
|
16
|
-
if
|
17
|
-
|
18
|
-
raise StandardError.new "No quantity_reference array provided for unit: #{
|
15
|
+
def validate_unit(unit)
|
16
|
+
if unit[:quantity_reference]
|
17
|
+
unit[:quantity_reference].is_a?(Array) or
|
18
|
+
raise StandardError.new "No quantity_reference array provided for unit: #{unit}"
|
19
19
|
end
|
20
|
-
if
|
21
|
-
|
22
|
-
raise StandardError.new "No unit_name array provided for unit: #{
|
20
|
+
if unit[:unit_name]
|
21
|
+
unit[:unit_name].is_a?(Array) or
|
22
|
+
raise StandardError.new "No unit_name array provided for unit: #{unit}"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -33,16 +33,16 @@ module Asciimath2UnitsML
|
|
33
33
|
"already used for #{m[s]}"
|
34
34
|
m[s] = v
|
35
35
|
end
|
36
|
-
m
|
36
|
+
m
|
37
37
|
end
|
38
38
|
|
39
|
-
def validate_unit_symbol_cardinality(
|
40
|
-
return true if
|
39
|
+
def validate_unit_symbol_cardinality(sym, k)
|
40
|
+
return true if sym.nil?
|
41
41
|
|
42
|
-
!
|
43
|
-
!
|
44
|
-
!
|
45
|
-
raise StandardError.new "malformed unit_symbol for #{k}: #{
|
42
|
+
!sym[:id].nil? && !sym[:ascii].nil? && !sym[:html].nil? &&
|
43
|
+
!sym[:mathml].nil? && !sym[:latex].nil? &&
|
44
|
+
!sym[:unicode].nil? and return true
|
45
|
+
raise StandardError.new "malformed unit_symbol for #{k}: #{sym}"
|
46
46
|
end
|
47
47
|
|
48
48
|
def symbol_key(v)
|
data/lib/unitsdb_ruby/unitsdb.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module UnitsDB
|
2
2
|
class Dimension
|
3
|
-
attr_reader :id, :length, :mass, :time, :electric_current,
|
3
|
+
attr_reader :id, :length, :mass, :time, :electric_current,
|
4
|
+
:thermodynamic_temperature,
|
4
5
|
:amount_of_substance, :luminous_intensity, :plane_angle, :dimensionless
|
5
6
|
|
6
7
|
def initialize(id, hash)
|
@@ -10,12 +11,16 @@ module UnitsDB
|
|
10
11
|
hash[:length] and @length = hash[:length][:powerNumerator].to_i
|
11
12
|
hash[:mass] and @mass = hash[:mass][:powerNumerator].to_i
|
12
13
|
hash[:time] and @time = hash[:time][:powerNumerator].to_i
|
13
|
-
hash[:electric_current] and
|
14
|
+
hash[:electric_current] and
|
15
|
+
@electric_current = hash[:electric_current][:powerNumerator].to_i
|
14
16
|
hash[:thermodynamic_temperature] and
|
15
17
|
@thermodynamic_temperature = hash[:thermodynamic_temperature][:powerNumerator].to_i
|
16
|
-
hash[:amount_of_substance] and
|
17
|
-
|
18
|
-
hash[:
|
18
|
+
hash[:amount_of_substance] and
|
19
|
+
@amount_of_substance = hash[:amount_of_substance][:powerNumerator].to_i
|
20
|
+
hash[:luminous_intensity] and
|
21
|
+
@luminous_intensity = hash[:luminous_intensity][:powerNumerator].to_i
|
22
|
+
hash[:plane_angle] and
|
23
|
+
@plane_angle = hash[:plane_angle][:powerNumerator].to_i
|
19
24
|
rescue
|
20
25
|
raise StandardError.new "Parse fail on Dimension #{id}: #{hash}"
|
21
26
|
end
|
@@ -48,7 +53,8 @@ module UnitsDB
|
|
48
53
|
end
|
49
54
|
|
50
55
|
def vector
|
51
|
-
"#{@length}:#{@mass}:#{@time}:#{@electric_current}
|
56
|
+
"#{@length}:#{@mass}:#{@time}:#{@electric_current}:"\
|
57
|
+
"#{@thermodynamic_temperature}:#{@amount_of_substance}:"\
|
52
58
|
"#{@luminous_intensity}:#{@plane_angle}"
|
53
59
|
end
|
54
60
|
end
|
@@ -102,7 +108,8 @@ module UnitsDB
|
|
102
108
|
@dimension = hash[:dimension_url].sub(/^#/, "")
|
103
109
|
@type = hash[:quantity_type]
|
104
110
|
hash[:quantity_name] and @names = hash[:quantity_name]
|
105
|
-
hash[:unit_reference] and
|
111
|
+
hash[:unit_reference] and
|
112
|
+
@units = hash[:unit_reference].map { |x| x[:url].sub(/^#/, "") }
|
106
113
|
rescue
|
107
114
|
raise StandardError.new "Parse fail on Quantity #{id}: #{hash}"
|
108
115
|
end
|
@@ -118,7 +125,8 @@ module UnitsDB
|
|
118
125
|
end
|
119
126
|
|
120
127
|
class Unit
|
121
|
-
attr_reader :id, :dimension, :short, :root, :unit_system, :names,
|
128
|
+
attr_reader :id, :dimension, :short, :root, :unit_system, :names,
|
129
|
+
:symbols, :symbols_hash, :root_units, :quantities,
|
122
130
|
:si_derived_bases, :prefixed
|
123
131
|
|
124
132
|
def initialize(id, hash)
|
@@ -129,11 +137,13 @@ module UnitsDB
|
|
129
137
|
hash[:short] && !hash[:short].empty? and @short = hash[:short]
|
130
138
|
@unit_system = hash[:unit_system]
|
131
139
|
@names = hash[:unit_name]
|
132
|
-
@symbols_hash =
|
140
|
+
@symbols_hash =
|
141
|
+
hash[:unit_symbols]&.each_with_object({}) { |h, m| m[h[:id]] = h } || {}
|
133
142
|
@symbols = hash[:unit_symbols]
|
134
143
|
hash[:root_units] and hash[:root_units][:enumerated_root_units] and
|
135
144
|
@root = hash[:root_units][:enumerated_root_units]
|
136
|
-
hash[:quantity_reference] and
|
145
|
+
hash[:quantity_reference] and
|
146
|
+
@quantities = hash[:quantity_reference].map { |x| x[:url].sub(/^#/, "") }
|
137
147
|
hash[:si_derived_bases] and @si_derived_bases = hash[:si_derived_bases]
|
138
148
|
@prefixed = (hash[:prefixed] == true)
|
139
149
|
rescue
|
@@ -158,7 +168,7 @@ module UnitsDB
|
|
158
168
|
end
|
159
169
|
|
160
170
|
def symbolids
|
161
|
-
@symbols ? @symbols.map { |s| s[:id] } : [
|
171
|
+
@symbols ? @symbols.map { |s| s[:id] } : [@short]
|
162
172
|
end
|
163
173
|
end
|
164
174
|
end
|
data/spec/conv_spec.rb
CHANGED
@@ -2,750 +2,729 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciimath2UnitsML do
|
4
4
|
it "converts an AsciiMath string to MathML + UnitsML" do
|
5
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
6
|
-
|
5
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
6
|
+
1 "unitsml(mm*s^-2)"
|
7
7
|
INPUT
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
<mrow>
|
17
|
-
<mi mathvariant='normal'>s</mi>
|
18
|
-
</mrow>
|
19
|
-
<mrow>
|
20
|
-
<mo>−</mo>
|
21
|
-
<mn>2</mn>
|
22
|
-
</mrow>
|
23
|
-
</msup>
|
24
|
-
</mrow>
|
25
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_mm.s-2' dimensionURL='#NISTd28'>
|
26
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
27
|
-
<UnitName xml:lang='en'>mm*s^-2</UnitName>
|
28
|
-
<UnitSymbol type='HTML'>
|
29
|
-
mm⋅s
|
30
|
-
<sup>−2</sup>
|
31
|
-
</UnitSymbol>
|
32
|
-
<UnitSymbol type='MathML'>
|
33
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
8
|
+
<?xml version='1.0'?>
|
9
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
10
|
+
<mn>1</mn>
|
11
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
12
|
+
<mrow xref='U_mm.s-2'>
|
13
|
+
<mi mathvariant='normal'>mm</mi>
|
14
|
+
<mo>⋅</mo>
|
15
|
+
<msup>
|
34
16
|
<mrow>
|
35
|
-
<mi mathvariant='normal'>
|
36
|
-
<mo>⋅</mo>
|
37
|
-
<msup>
|
38
|
-
<mrow>
|
39
|
-
<mi mathvariant='normal'>s</mi>
|
40
|
-
</mrow>
|
41
|
-
<mrow>
|
42
|
-
<mo>−</mo>
|
43
|
-
<mn>2</mn>
|
44
|
-
</mrow>
|
45
|
-
</msup>
|
17
|
+
<mi mathvariant='normal'>s</mi>
|
46
18
|
</mrow>
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
</
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
19
|
+
<mrow>
|
20
|
+
<mo>−</mo>
|
21
|
+
<mn>2</mn>
|
22
|
+
</mrow>
|
23
|
+
</msup>
|
24
|
+
</mrow>
|
25
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_mm.s-2' dimensionURL='#NISTd28'>
|
26
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
27
|
+
<UnitName xml:lang='en'>mm*s^-2</UnitName>
|
28
|
+
<UnitSymbol type='HTML'>
|
29
|
+
mm⋅s
|
30
|
+
<sup>−2</sup>
|
31
|
+
</UnitSymbol>
|
32
|
+
<UnitSymbol type='MathML'>
|
33
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
34
|
+
<mrow>
|
35
|
+
<mi mathvariant='normal'>mm</mi>
|
36
|
+
<mo>⋅</mo>
|
37
|
+
<msup>
|
38
|
+
<mrow>
|
39
|
+
<mi mathvariant='normal'>s</mi>
|
40
|
+
</mrow>
|
41
|
+
<mrow>
|
42
|
+
<mo>−</mo>
|
43
|
+
<mn>2</mn>
|
44
|
+
</mrow>
|
45
|
+
</msup>
|
46
|
+
</mrow>
|
47
|
+
</math>
|
48
|
+
</UnitSymbol>
|
49
|
+
<RootUnits>
|
50
|
+
<EnumeratedRootUnit unit='meter' prefix='m'/>
|
51
|
+
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
52
|
+
</RootUnits>
|
53
|
+
</Unit>
|
54
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-3' xml:id='NISTp10_-3'>
|
55
|
+
<PrefixName xml:lang='en'>milli</PrefixName>
|
56
|
+
<PrefixSymbol type='ASCII'>m</PrefixSymbol>
|
57
|
+
<PrefixSymbol type='unicode'>m</PrefixSymbol>
|
58
|
+
<PrefixSymbol type='LaTeX'>m</PrefixSymbol>
|
59
|
+
<PrefixSymbol type='HTML'>m</PrefixSymbol>
|
60
|
+
</Prefix>
|
61
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd28'>
|
62
|
+
<Length symbol='L' powerNumerator='1'/>
|
63
|
+
<Time symbol='T' powerNumerator='-2'/>
|
64
|
+
</Dimension>
|
65
|
+
</math>
|
66
66
|
OUTPUT
|
67
67
|
end
|
68
68
|
|
69
69
|
it "deals with non-Ascii units and prefixes" do
|
70
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
71
|
-
|
70
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
71
|
+
1 "unitsml(um)"
|
72
72
|
INPUT
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
<mi mathvariant='normal'>µm</mi>
|
79
|
-
</mrow>
|
80
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_um' dimensionURL='#NISTd1'>
|
81
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
82
|
-
<UnitName xml:lang='en'>um</UnitName>
|
83
|
-
<UnitSymbol type='HTML'>um</UnitSymbol>
|
84
|
-
<UnitSymbol type='MathML'>
|
85
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
86
|
-
<mrow>
|
73
|
+
<?xml version='1.0'?>
|
74
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
75
|
+
<mn>1</mn>
|
76
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
77
|
+
<mrow xref='U_um'>
|
87
78
|
<mi mathvariant='normal'>µm</mi>
|
88
79
|
</mrow>
|
80
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_um' dimensionURL='#NISTd1'>
|
81
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
82
|
+
<UnitName xml:lang='en'>um</UnitName>
|
83
|
+
<UnitSymbol type='HTML'>um</UnitSymbol>
|
84
|
+
<UnitSymbol type='MathML'>
|
85
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
86
|
+
<mrow>
|
87
|
+
<mi mathvariant='normal'>µm</mi>
|
88
|
+
</mrow>
|
89
|
+
</math>
|
90
|
+
</UnitSymbol>
|
91
|
+
<RootUnits>
|
92
|
+
<EnumeratedRootUnit unit='meter' prefix='u'/>
|
93
|
+
</RootUnits>
|
94
|
+
</Unit>
|
95
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-6' xml:id='NISTp10_-6'>
|
96
|
+
<PrefixName xml:lang='en'>micro</PrefixName>
|
97
|
+
<PrefixSymbol type='ASCII'>u</PrefixSymbol>
|
98
|
+
<PrefixSymbol type='unicode'>μ</PrefixSymbol>
|
99
|
+
<PrefixSymbol type='LaTeX'>$mu$</PrefixSymbol>
|
100
|
+
<PrefixSymbol type='HTML'>µ</PrefixSymbol>
|
101
|
+
</Prefix>
|
102
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
103
|
+
<Length symbol='L' powerNumerator='1'/>
|
104
|
+
</Dimension>
|
89
105
|
</math>
|
90
|
-
|
91
|
-
|
92
|
-
<EnumeratedRootUnit unit='meter' prefix='u'/>
|
93
|
-
</RootUnits>
|
94
|
-
</Unit>
|
95
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-6' xml:id='NISTp10_-6'>
|
96
|
-
<PrefixName xml:lang='en'>micro</PrefixName>
|
97
|
-
<PrefixSymbol type='ASCII'>u</PrefixSymbol>
|
98
|
-
<PrefixSymbol type='unicode'>μ</PrefixSymbol>
|
99
|
-
<PrefixSymbol type='LaTeX'>$mu$</PrefixSymbol>
|
100
|
-
<PrefixSymbol type='HTML'>µ</PrefixSymbol>
|
101
|
-
</Prefix>
|
102
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
103
|
-
<Length symbol='L' powerNumerator='1'/>
|
104
|
-
</Dimension>
|
105
|
-
</math>
|
106
|
-
OUTPUT
|
107
|
-
end
|
106
|
+
OUTPUT
|
107
|
+
end
|
108
108
|
|
109
109
|
it "does not insert space before non-alphabetic units" do
|
110
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
111
|
-
|
112
|
-
INPUT
|
113
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
OUTPUT
|
222
|
-
|
110
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
111
|
+
1 "unitsml(degK)" + 1 "unitsml(prime)" + ii(theta) = s//r "unitsml(rad)" + 10^(12) "unitsml(Hz)"
|
112
|
+
INPUT
|
113
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
114
|
+
<mn>1</mn>
|
115
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
116
|
+
<mrow xref='U_NISTu5'>
|
117
|
+
<mi mathvariant='normal'>°K</mi>
|
118
|
+
</mrow>
|
119
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu5' dimensionURL='#NISTd5'>
|
120
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
121
|
+
<UnitName xml:lang='en'>kelvin</UnitName>
|
122
|
+
<UnitSymbol type='HTML'>K</UnitSymbol>
|
123
|
+
<UnitSymbol type='MathML'>
|
124
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
125
|
+
<mrow>
|
126
|
+
<mi mathvariant='normal'>K</mi>
|
127
|
+
</mrow>
|
128
|
+
</math>
|
129
|
+
</UnitSymbol>
|
130
|
+
</Unit>
|
131
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd5'>
|
132
|
+
<ThermodynamicTemperature symbol='Theta' powerNumerator='1'/>
|
133
|
+
</Dimension>
|
134
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq5' dimensionURL='#NISTd5' quantityType='base'>
|
135
|
+
<QuantityName xml:lang='en-US'>thermodynamic temperature</QuantityName>
|
136
|
+
</Quantity>
|
137
|
+
<mo>+</mo>
|
138
|
+
<mn>1</mn>
|
139
|
+
<mo>⁢</mo>
|
140
|
+
<mrow xref='U_NISTu147'>
|
141
|
+
<mi mathvariant='normal'>′</mi>
|
142
|
+
</mrow>
|
143
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu147'>
|
144
|
+
<UnitSystem name='not_SI' type='not_SI' xml:lang='en-US'/>
|
145
|
+
<UnitName xml:lang='en'>minute (minute of arc)</UnitName>
|
146
|
+
<UnitSymbol type='HTML'>′</UnitSymbol>
|
147
|
+
<UnitSymbol type='MathML'>
|
148
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
149
|
+
<mrow>
|
150
|
+
<mi mathvariant='normal'>′</mi>
|
151
|
+
</mrow>
|
152
|
+
</math>
|
153
|
+
</UnitSymbol>
|
154
|
+
</Unit>
|
155
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd9'>
|
156
|
+
<PlaneAngle symbol='Phi' powerNumerator='1'/>
|
157
|
+
</Dimension>
|
158
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq9' dimensionURL='#NISTd9' quantityType='base'>
|
159
|
+
<QuantityName xml:lang='en-US'>plane angle</QuantityName>
|
160
|
+
<QuantityName xml:lang='en-US'>angle</QuantityName>
|
161
|
+
</Quantity>
|
162
|
+
<mo>+</mo>
|
163
|
+
<mstyle mathvariant='italic'>
|
164
|
+
<mi>θ</mi>
|
165
|
+
</mstyle>
|
166
|
+
<mo>=</mo>
|
167
|
+
<mi>s</mi>
|
168
|
+
<mo>/</mo>
|
169
|
+
<mi>r</mi>
|
170
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
171
|
+
<mrow xref='U_NISTu9'>
|
172
|
+
<mi mathvariant='normal'>rad</mi>
|
173
|
+
</mrow>
|
174
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu9' dimensionURL='#D_L0'>
|
175
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
176
|
+
<UnitName xml:lang='en'>radian</UnitName>
|
177
|
+
<UnitSymbol type='HTML'>rad</UnitSymbol>
|
178
|
+
<UnitSymbol type='MathML'>
|
179
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
180
|
+
<mrow>
|
181
|
+
<mi mathvariant='normal'>rad</mi>
|
182
|
+
</mrow>
|
183
|
+
</math>
|
184
|
+
</UnitSymbol>
|
185
|
+
</Unit>
|
186
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='D_L0'>
|
187
|
+
<Length symbol='L' powerNumerator='0'/>
|
188
|
+
</Dimension>
|
189
|
+
<mo>+</mo>
|
190
|
+
<msup>
|
191
|
+
<mrow>
|
192
|
+
<mn>10</mn>
|
193
|
+
</mrow>
|
194
|
+
<mrow>
|
195
|
+
<mn>12</mn>
|
196
|
+
</mrow>
|
197
|
+
</msup>
|
198
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
199
|
+
<mrow xref='U_NISTu31'>
|
200
|
+
<mi mathvariant='normal'>Hz</mi>
|
201
|
+
</mrow>
|
202
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu31' dimensionURL='#NISTd24'>
|
203
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
204
|
+
<UnitName xml:lang='en'>hertz</UnitName>
|
205
|
+
<UnitSymbol type='HTML'>Hz</UnitSymbol>
|
206
|
+
<UnitSymbol type='MathML'>
|
207
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
208
|
+
<mrow>
|
209
|
+
<mi mathvariant='normal'>Hz</mi>
|
210
|
+
</mrow>
|
211
|
+
</math>
|
212
|
+
</UnitSymbol>
|
213
|
+
</Unit>
|
214
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd24'>
|
215
|
+
<Time symbol='T' powerNumerator='-1'/>
|
216
|
+
</Dimension>
|
217
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq45' dimensionURL='#NISTd24' quantityType='base'>
|
218
|
+
<QuantityName xml:lang='en-US'>frequency</QuantityName>
|
219
|
+
</Quantity>
|
220
|
+
</math>
|
221
|
+
OUTPUT
|
222
|
+
end
|
223
223
|
|
224
224
|
it "does not insert space before operators" do
|
225
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
226
|
-
|
227
|
-
INPUT
|
228
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
<mi mathvariant='normal'>kg</mi>
|
233
|
-
</mrow>
|
234
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu2' dimensionURL='#NISTd2'>
|
235
|
-
<UnitSystem name='SI' type='SI_base' xml:lang='en-US'/>
|
236
|
-
<UnitName xml:lang='en'>kilogram</UnitName>
|
237
|
-
<UnitSymbol type='HTML'>kg</UnitSymbol>
|
238
|
-
<UnitSymbol type='MathML'>
|
239
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
240
|
-
<mrow>
|
225
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
226
|
+
8 "unitsml(kg)" cdot "unitsml(m)"
|
227
|
+
INPUT
|
228
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
229
|
+
<mn>8</mn>
|
230
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
231
|
+
<mrow xref='U_NISTu2'>
|
241
232
|
<mi mathvariant='normal'>kg</mi>
|
242
233
|
</mrow>
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
<mrow>
|
234
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu2' dimensionURL='#NISTd2'>
|
235
|
+
<UnitSystem name='SI' type='SI_base' xml:lang='en-US'/>
|
236
|
+
<UnitName xml:lang='en'>kilogram</UnitName>
|
237
|
+
<UnitSymbol type='HTML'>kg</UnitSymbol>
|
238
|
+
<UnitSymbol type='MathML'>
|
239
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
240
|
+
<mrow>
|
241
|
+
<mi mathvariant='normal'>kg</mi>
|
242
|
+
</mrow>
|
243
|
+
</math>
|
244
|
+
</UnitSymbol>
|
245
|
+
<RootUnits>
|
246
|
+
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
247
|
+
</RootUnits>
|
248
|
+
</Unit>
|
249
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
250
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
251
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
252
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
253
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
254
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
255
|
+
</Prefix>
|
256
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd2'>
|
257
|
+
<Mass symbol='M' powerNumerator='1'/>
|
258
|
+
</Dimension>
|
259
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq2' dimensionURL='#NISTd2' quantityType='base'>
|
260
|
+
<QuantityName xml:lang='en-US'>mass</QuantityName>
|
261
|
+
</Quantity>
|
262
|
+
<mo>⋅</mo>
|
263
|
+
<mrow xref='U_NISTu1'>
|
273
264
|
<mi mathvariant='normal'>m</mi>
|
274
265
|
</mrow>
|
266
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu1' dimensionURL='#NISTd1'>
|
267
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
268
|
+
<UnitName xml:lang='en'>meter</UnitName>
|
269
|
+
<UnitSymbol type='HTML'>m</UnitSymbol>
|
270
|
+
<UnitSymbol type='MathML'>
|
271
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
272
|
+
<mrow>
|
273
|
+
<mi mathvariant='normal'>m</mi>
|
274
|
+
</mrow>
|
275
|
+
</math>
|
276
|
+
</UnitSymbol>
|
277
|
+
</Unit>
|
278
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
279
|
+
<Length symbol='L' powerNumerator='1'/>
|
280
|
+
</Dimension>
|
275
281
|
</math>
|
276
|
-
|
277
|
-
</Unit>
|
278
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
279
|
-
<Length symbol='L' powerNumerator='1'/>
|
280
|
-
</Dimension>
|
281
|
-
</math>
|
282
|
-
OUTPUT
|
282
|
+
OUTPUT
|
283
283
|
end
|
284
284
|
|
285
285
|
it "deals with sqrt units" do
|
286
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
287
|
-
|
286
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
287
|
+
1 "unitsml(sqrt(Hz))"
|
288
288
|
INPUT
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
<msqrt>
|
294
|
-
<mi mathvariant='normal'>Hz</mi>
|
295
|
-
</msqrt>
|
296
|
-
</mrow>
|
297
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_Hz0.5' dimensionURL='#D_T-0.5'>
|
298
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
299
|
-
<UnitName xml:lang='en'>Hz^0.5</UnitName>
|
300
|
-
<UnitSymbol type='HTML'>√Hz</UnitSymbol>
|
301
|
-
<UnitSymbol type='MathML'>
|
302
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
303
|
-
<mrow>
|
289
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
290
|
+
<mn>1</mn>
|
291
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
292
|
+
<mrow xref='U_sqrtHz'>
|
304
293
|
<msqrt>
|
305
294
|
<mi mathvariant='normal'>Hz</mi>
|
306
295
|
</msqrt>
|
307
296
|
</mrow>
|
297
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_Hz0.5' dimensionURL='#D_T-0.5'>
|
298
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
299
|
+
<UnitName xml:lang='en'>Hz^0.5</UnitName>
|
300
|
+
<UnitSymbol type='HTML'>√Hz</UnitSymbol>
|
301
|
+
<UnitSymbol type='MathML'>
|
302
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
303
|
+
<mrow>
|
304
|
+
<msqrt>
|
305
|
+
<mi mathvariant='normal'>Hz</mi>
|
306
|
+
</msqrt>
|
307
|
+
</mrow>
|
308
|
+
</math>
|
309
|
+
</UnitSymbol>
|
310
|
+
</Unit>
|
311
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='D_T-0.5'>
|
312
|
+
<Time symbol='T' powerNumerator='-0.5'/>
|
313
|
+
</Dimension>
|
308
314
|
</math>
|
309
|
-
</UnitSymbol>
|
310
|
-
</Unit>
|
311
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='D_T-0.5'>
|
312
|
-
<Time symbol='T' powerNumerator='-0.5'/>
|
313
|
-
</Dimension>
|
314
|
-
</math>
|
315
315
|
OUTPUT
|
316
316
|
end
|
317
317
|
|
318
318
|
it "deals with kg and g" do
|
319
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
320
|
-
|
319
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
320
|
+
1 "unitsml(kg)" + 1 "unitsml(g)"
|
321
321
|
INPUT
|
322
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
323
|
-
<mn>1</mn>
|
324
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
325
|
-
<mrow xref='U_NISTu2'>
|
326
|
-
<mi mathvariant='normal'>kg</mi>
|
327
|
-
</mrow>
|
328
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu2' dimensionURL='#NISTd2'>
|
329
|
-
<UnitSystem name='SI' type='SI_base' xml:lang='en-US'/>
|
330
|
-
<UnitName xml:lang='en'>kilogram</UnitName>
|
331
|
-
<UnitSymbol type='HTML'>kg</UnitSymbol>
|
332
|
-
<UnitSymbol type='MathML'>
|
333
322
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
334
|
-
<
|
323
|
+
<mn>1</mn>
|
324
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
325
|
+
<mrow xref='U_NISTu2'>
|
335
326
|
<mi mathvariant='normal'>kg</mi>
|
336
327
|
</mrow>
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
</
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
<mrow>
|
328
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu2' dimensionURL='#NISTd2'>
|
329
|
+
<UnitSystem name='SI' type='SI_base' xml:lang='en-US'/>
|
330
|
+
<UnitName xml:lang='en'>kilogram</UnitName>
|
331
|
+
<UnitSymbol type='HTML'>kg</UnitSymbol>
|
332
|
+
<UnitSymbol type='MathML'>
|
333
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
334
|
+
<mrow>
|
335
|
+
<mi mathvariant='normal'>kg</mi>
|
336
|
+
</mrow>
|
337
|
+
</math>
|
338
|
+
</UnitSymbol>
|
339
|
+
<RootUnits>
|
340
|
+
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
341
|
+
</RootUnits>
|
342
|
+
</Unit>
|
343
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
344
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
345
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
346
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
347
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
348
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
349
|
+
</Prefix>
|
350
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd2'>
|
351
|
+
<Mass symbol='M' powerNumerator='1'/>
|
352
|
+
</Dimension>
|
353
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq2' dimensionURL='#NISTd2' quantityType='base'>
|
354
|
+
<QuantityName xml:lang='en-US'>mass</QuantityName>
|
355
|
+
</Quantity>
|
356
|
+
<mo>+</mo>
|
357
|
+
<mn>1</mn>
|
358
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
359
|
+
<mrow xref='U_NISTu27'>
|
369
360
|
<mi mathvariant='normal'>g</mi>
|
370
361
|
</mrow>
|
362
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu27' dimensionURL='#NISTd2'>
|
363
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
364
|
+
<UnitName xml:lang='en'>gram</UnitName>
|
365
|
+
<UnitSymbol type='HTML'>g</UnitSymbol>
|
366
|
+
<UnitSymbol type='MathML'>
|
367
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
368
|
+
<mrow>
|
369
|
+
<mi mathvariant='normal'>g</mi>
|
370
|
+
</mrow>
|
371
|
+
</math>
|
372
|
+
</UnitSymbol>
|
373
|
+
</Unit>
|
371
374
|
</math>
|
372
|
-
</UnitSymbol>
|
373
|
-
</Unit>
|
374
|
-
</math>
|
375
375
|
OUTPUT
|
376
376
|
end
|
377
377
|
|
378
378
|
it "deals with non-metric" do
|
379
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
380
|
-
|
379
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
380
|
+
1 "unitsml(hp)"
|
381
381
|
INPUT
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
<mi mathvariant='normal'>hp</mi>
|
387
|
-
</mrow>
|
388
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu284'>
|
389
|
-
<UnitSystem name='not_SI' type='not_SI' xml:lang='en-US'/>
|
390
|
-
<UnitName xml:lang='en'>horsepower</UnitName>
|
391
|
-
<UnitSymbol type='HTML'>hp</UnitSymbol>
|
392
|
-
<UnitSymbol type='MathML'>
|
393
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
394
|
-
<mrow>
|
382
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
383
|
+
<mn>1</mn>
|
384
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
385
|
+
<mrow xref='U_NISTu284'>
|
395
386
|
<mi mathvariant='normal'>hp</mi>
|
396
387
|
</mrow>
|
388
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu284'>
|
389
|
+
<UnitSystem name='not_SI' type='not_SI' xml:lang='en-US'/>
|
390
|
+
<UnitName xml:lang='en'>horsepower</UnitName>
|
391
|
+
<UnitSymbol type='HTML'>hp</UnitSymbol>
|
392
|
+
<UnitSymbol type='MathML'>
|
393
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
394
|
+
<mrow>
|
395
|
+
<mi mathvariant='normal'>hp</mi>
|
396
|
+
</mrow>
|
397
|
+
</math>
|
398
|
+
</UnitSymbol>
|
399
|
+
</Unit>
|
400
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd16'>
|
401
|
+
<Length symbol='L' powerNumerator='2'/>
|
402
|
+
<Mass symbol='M' powerNumerator='1'/>
|
403
|
+
<Time symbol='T' powerNumerator='-3'/>
|
404
|
+
</Dimension>
|
405
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq20' dimensionURL='#NISTd16' quantityType='base'>
|
406
|
+
<QuantityName xml:lang='en-US'>power</QuantityName>
|
407
|
+
</Quantity>
|
397
408
|
</math>
|
398
|
-
</UnitSymbol>
|
399
|
-
</Unit>
|
400
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd16'>
|
401
|
-
<Length symbol='L' powerNumerator='2'/>
|
402
|
-
<Mass symbol='M' powerNumerator='1'/>
|
403
|
-
<Time symbol='T' powerNumerator='-3'/>
|
404
|
-
</Dimension>
|
405
|
-
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq20' dimensionURL='#NISTd16' quantityType='base'>
|
406
|
-
<QuantityName xml:lang='en-US'>power</QuantityName>
|
407
|
-
</Quantity>
|
408
|
-
</math>
|
409
409
|
OUTPUT
|
410
410
|
end
|
411
411
|
|
412
412
|
it "deals with duplicate units" do
|
413
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
414
|
-
|
413
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
414
|
+
1 "unitsml(kg*s^-2)" xx 9 "unitsml(kg*s^-2)"
|
415
415
|
INPUT
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
<mrow>
|
424
|
-
<mi mathvariant='normal'>s</mi>
|
425
|
-
</mrow>
|
426
|
-
<mrow>
|
427
|
-
<mo>−</mo>
|
428
|
-
<mn>2</mn>
|
429
|
-
</mrow>
|
430
|
-
</msup>
|
431
|
-
</mrow>
|
432
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg.s-2' dimensionURL='#NISTd37'>
|
433
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
434
|
-
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
435
|
-
<UnitSymbol type='HTML'>
|
436
|
-
kg⋅s
|
437
|
-
<sup>−2</sup>
|
438
|
-
</UnitSymbol>
|
439
|
-
<UnitSymbol type='MathML'>
|
440
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
416
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
417
|
+
<mn>1</mn>
|
418
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
419
|
+
<mrow xref='U_kg.s-2'>
|
420
|
+
<mi mathvariant='normal'>kg</mi>
|
421
|
+
<mo>⋅</mo>
|
422
|
+
<msup>
|
441
423
|
<mrow>
|
442
|
-
<mi mathvariant='normal'>
|
443
|
-
<mo>⋅</mo>
|
444
|
-
<msup>
|
445
|
-
<mrow>
|
446
|
-
<mi mathvariant='normal'>s</mi>
|
447
|
-
</mrow>
|
448
|
-
<mrow>
|
449
|
-
<mo>−</mo>
|
450
|
-
<mn>2</mn>
|
451
|
-
</mrow>
|
452
|
-
</msup>
|
424
|
+
<mi mathvariant='normal'>s</mi>
|
453
425
|
</mrow>
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
</
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
426
|
+
<mrow>
|
427
|
+
<mo>−</mo>
|
428
|
+
<mn>2</mn>
|
429
|
+
</mrow>
|
430
|
+
</msup>
|
431
|
+
</mrow>
|
432
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg.s-2' dimensionURL='#NISTd37'>
|
433
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
434
|
+
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
435
|
+
<UnitSymbol type='HTML'>
|
436
|
+
kg⋅s
|
437
|
+
<sup>−2</sup>
|
438
|
+
</UnitSymbol>
|
439
|
+
<UnitSymbol type='MathML'>
|
440
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
441
|
+
<mrow>
|
442
|
+
<mi mathvariant='normal'>kg</mi>
|
443
|
+
<mo>⋅</mo>
|
444
|
+
<msup>
|
445
|
+
<mrow>
|
446
|
+
<mi mathvariant='normal'>s</mi>
|
447
|
+
</mrow>
|
448
|
+
<mrow>
|
449
|
+
<mo>−</mo>
|
450
|
+
<mn>2</mn>
|
451
|
+
</mrow>
|
452
|
+
</msup>
|
453
|
+
</mrow>
|
454
|
+
</math>
|
455
|
+
</UnitSymbol>
|
456
|
+
<RootUnits>
|
457
|
+
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
458
|
+
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
459
|
+
</RootUnits>
|
460
|
+
</Unit>
|
461
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
462
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
463
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
464
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
465
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
466
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
467
|
+
</Prefix>
|
468
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd37'>
|
469
|
+
<Mass symbol='M' powerNumerator='1'/>
|
470
|
+
<Time symbol='T' powerNumerator='-2'/>
|
471
|
+
</Dimension>
|
472
|
+
<mo>×</mo>
|
473
|
+
<mn>9</mn>
|
474
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
475
|
+
<mrow xref='U_kg.s-2'>
|
476
|
+
<mi mathvariant='normal'>kg</mi>
|
477
|
+
<mo>⋅</mo>
|
478
|
+
<msup>
|
479
|
+
<mrow>
|
480
|
+
<mi mathvariant='normal'>s</mi>
|
481
|
+
</mrow>
|
482
|
+
<mrow>
|
483
|
+
<mo>−</mo>
|
484
|
+
<mn>2</mn>
|
485
|
+
</mrow>
|
486
|
+
</msup>
|
487
|
+
</mrow>
|
488
|
+
</math>
|
489
489
|
OUTPUT
|
490
490
|
end
|
491
491
|
|
492
492
|
it "deals with parentheses" do
|
493
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
494
|
-
|
493
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
494
|
+
10 "unitsml(K/(kg*m))"
|
495
495
|
INPUT
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
496
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
497
|
+
<mn>10</mn>
|
498
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
499
|
+
<mrow xref='U_K/kg.m'>
|
500
|
+
<mi mathvariant='normal'>K</mi>
|
501
|
+
<mo>/</mo>
|
502
|
+
<mi mathvariant='normal'>kg</mi>
|
503
|
+
<mo>⋅</mo>
|
504
|
+
<mi mathvariant='normal'>m</mi>
|
505
|
+
</mrow>
|
506
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_K.kg-1.m-1' dimensionURL='#D_L-1M-1Theta'>
|
507
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
508
|
+
<UnitName xml:lang='en'>K*kg^-1*m^-1</UnitName>
|
509
|
+
<UnitSymbol type='HTML'>
|
510
|
+
K⋅kg
|
511
|
+
<sup>−1</sup>
|
512
|
+
⋅m
|
513
|
+
<sup>−1</sup>
|
514
|
+
</UnitSymbol>
|
515
|
+
<UnitSymbol type='MathML'>
|
516
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
517
|
+
<mrow>
|
518
|
+
<mi mathvariant='normal'>K</mi>
|
519
|
+
<mo>⋅</mo>
|
520
|
+
<msup>
|
521
|
+
<mrow>
|
522
|
+
<mi mathvariant='normal'>kg</mi>
|
523
|
+
</mrow>
|
524
|
+
<mrow>
|
525
|
+
<mo>−</mo>
|
526
|
+
<mn>1</mn>
|
527
|
+
</mrow>
|
528
|
+
</msup>
|
529
|
+
<mo>⋅</mo>
|
530
|
+
<msup>
|
531
|
+
<mrow>
|
532
|
+
<mi mathvariant='normal'>m</mi>
|
533
|
+
</mrow>
|
534
|
+
<mrow>
|
535
|
+
<mo>−</mo>
|
536
|
+
<mn>1</mn>
|
537
|
+
</mrow>
|
538
|
+
</msup>
|
539
|
+
</mrow>
|
540
|
+
</math>
|
541
|
+
</UnitSymbol>
|
542
|
+
<RootUnits>
|
543
|
+
<EnumeratedRootUnit unit='kelvin'/>
|
544
|
+
<EnumeratedRootUnit unit='gram' prefix='k' powerNumerator='-1'/>
|
545
|
+
<EnumeratedRootUnit unit='meter' powerNumerator='-1'/>
|
546
|
+
</RootUnits>
|
547
|
+
</Unit>
|
548
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
549
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
550
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
551
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
552
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
553
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
554
|
+
</Prefix>
|
555
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='D_L-1M-1Theta'>
|
556
|
+
<Length symbol='L' powerNumerator='-1'/>
|
557
|
+
<Mass symbol='M' powerNumerator='-1'/>
|
558
|
+
<ThermodynamicTemperature symbol='Theta' powerNumerator='1'/>
|
559
|
+
</Dimension>
|
560
|
+
</math>
|
561
561
|
OUTPUT
|
562
562
|
end
|
563
563
|
|
564
564
|
it "deals with notational variants" do
|
565
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
566
|
-
|
567
|
-
INPUT
|
568
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
569
|
-
<mn>9</mn>
|
570
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
571
|
-
<mrow xref='U_NISTu5'>
|
572
|
-
<mi mathvariant='normal'>°K</mi>
|
573
|
-
</mrow>
|
574
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu5' dimensionURL='#NISTd5'>
|
575
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
576
|
-
<UnitName xml:lang='en'>kelvin</UnitName>
|
577
|
-
<UnitSymbol type='HTML'>K</UnitSymbol>
|
578
|
-
<UnitSymbol type='MathML'>
|
565
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
566
|
+
9 "unitsml(degK)" + 10 "unitsml(K)"
|
567
|
+
INPUT
|
579
568
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
580
|
-
<
|
569
|
+
<mn>9</mn>
|
570
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
571
|
+
<mrow xref='U_NISTu5'>
|
572
|
+
<mi mathvariant='normal'>°K</mi>
|
573
|
+
</mrow>
|
574
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu5' dimensionURL='#NISTd5'>
|
575
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
576
|
+
<UnitName xml:lang='en'>kelvin</UnitName>
|
577
|
+
<UnitSymbol type='HTML'>K</UnitSymbol>
|
578
|
+
<UnitSymbol type='MathML'>
|
579
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
580
|
+
<mrow>
|
581
|
+
<mi mathvariant='normal'>K</mi>
|
582
|
+
</mrow>
|
583
|
+
</math>
|
584
|
+
</UnitSymbol>
|
585
|
+
</Unit>
|
586
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd5'>
|
587
|
+
<ThermodynamicTemperature symbol='Theta' powerNumerator='1'/>
|
588
|
+
</Dimension>
|
589
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq5' dimensionURL='#NISTd5' quantityType='base'>
|
590
|
+
<QuantityName xml:lang='en-US'>thermodynamic temperature</QuantityName>
|
591
|
+
</Quantity>
|
592
|
+
<mo>+</mo>
|
593
|
+
<mn>10</mn>
|
594
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
595
|
+
<mrow xref='U_NISTu5'>
|
581
596
|
<mi mathvariant='normal'>K</mi>
|
582
597
|
</mrow>
|
583
598
|
</math>
|
584
|
-
|
585
|
-
</Unit>
|
586
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd5'>
|
587
|
-
<ThermodynamicTemperature symbol='Theta' powerNumerator='1'/>
|
588
|
-
</Dimension>
|
589
|
-
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq5' dimensionURL='#NISTd5' quantityType='base'>
|
590
|
-
<QuantityName xml:lang='en-US'>thermodynamic temperature</QuantityName>
|
591
|
-
</Quantity>
|
592
|
-
<mo>+</mo>
|
593
|
-
<mn>10</mn>
|
594
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
595
|
-
<mrow xref='U_NISTu5'>
|
596
|
-
<mi mathvariant='normal'>K</mi>
|
597
|
-
</mrow>
|
598
|
-
</math>
|
599
|
-
OUTPUT
|
599
|
+
OUTPUT
|
600
600
|
end
|
601
601
|
|
602
602
|
it "deals with prefixed units" do
|
603
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
604
|
-
|
605
|
-
INPUT
|
606
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
607
|
-
<mn>9</mn>
|
608
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
609
|
-
<mrow xref='U_NISTu362'>
|
610
|
-
<mi mathvariant='normal'>mbar</mi>
|
611
|
-
</mrow>
|
612
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu362'>
|
613
|
-
<UnitSystem name='not_SI' type='not_SI' xml:lang='en-US'/>
|
614
|
-
<UnitName xml:lang='en'>millibar</UnitName>
|
615
|
-
<UnitSymbol type='HTML'>mbar</UnitSymbol>
|
616
|
-
<UnitSymbol type='MathML'>
|
603
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
604
|
+
9 "unitsml(mbar)"
|
605
|
+
INPUT
|
617
606
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
618
|
-
<
|
607
|
+
<mn>9</mn>
|
608
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
609
|
+
<mrow xref='U_NISTu362'>
|
619
610
|
<mi mathvariant='normal'>mbar</mi>
|
620
611
|
</mrow>
|
612
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu362'>
|
613
|
+
<UnitSystem name='not_SI' type='not_SI' xml:lang='en-US'/>
|
614
|
+
<UnitName xml:lang='en'>millibar</UnitName>
|
615
|
+
<UnitSymbol type='HTML'>mbar</UnitSymbol>
|
616
|
+
<UnitSymbol type='MathML'>
|
617
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
618
|
+
<mrow>
|
619
|
+
<mi mathvariant='normal'>mbar</mi>
|
620
|
+
</mrow>
|
621
|
+
</math>
|
622
|
+
</UnitSymbol>
|
623
|
+
<RootUnits>
|
624
|
+
<EnumeratedRootUnit unit='bar' prefix='m'/>
|
625
|
+
</RootUnits>
|
626
|
+
</Unit>
|
627
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-3' xml:id='NISTp10_-3'>
|
628
|
+
<PrefixName xml:lang='en'>milli</PrefixName>
|
629
|
+
<PrefixSymbol type='ASCII'>m</PrefixSymbol>
|
630
|
+
<PrefixSymbol type='unicode'>m</PrefixSymbol>
|
631
|
+
<PrefixSymbol type='LaTeX'>m</PrefixSymbol>
|
632
|
+
<PrefixSymbol type='HTML'>m</PrefixSymbol>
|
633
|
+
</Prefix>
|
634
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd14'>
|
635
|
+
<Length symbol='L' powerNumerator='-1'/>
|
636
|
+
<Mass symbol='M' powerNumerator='1'/>
|
637
|
+
<Time symbol='T' powerNumerator='-2'/>
|
638
|
+
</Dimension>
|
621
639
|
</math>
|
622
|
-
|
623
|
-
<RootUnits>
|
624
|
-
<EnumeratedRootUnit unit='bar' prefix='m'/>
|
625
|
-
</RootUnits>
|
626
|
-
</Unit>
|
627
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-3' xml:id='NISTp10_-3'>
|
628
|
-
<PrefixName xml:lang='en'>milli</PrefixName>
|
629
|
-
<PrefixSymbol type='ASCII'>m</PrefixSymbol>
|
630
|
-
<PrefixSymbol type='unicode'>m</PrefixSymbol>
|
631
|
-
<PrefixSymbol type='LaTeX'>m</PrefixSymbol>
|
632
|
-
<PrefixSymbol type='HTML'>m</PrefixSymbol>
|
633
|
-
</Prefix>
|
634
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd14'>
|
635
|
-
<Length symbol='L' powerNumerator='-1'/>
|
636
|
-
<Mass symbol='M' powerNumerator='1'/>
|
637
|
-
<Time symbol='T' powerNumerator='-2'/>
|
638
|
-
</Dimension>
|
639
|
-
</math>
|
640
|
-
OUTPUT
|
640
|
+
OUTPUT
|
641
641
|
end
|
642
642
|
|
643
643
|
it "deals with standalone prefixes" do
|
644
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
645
|
-
|
644
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
645
|
+
"unitsml(p-)" "unitsml(da-)"
|
646
646
|
INPUT
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
</math>
|
647
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
648
|
+
<mrow xref='NISTp10_-12'>
|
649
|
+
<mi mathvariant='normal'>p</mi>
|
650
|
+
</mrow>
|
651
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-12' xml:id='NISTp10_-12'>
|
652
|
+
<PrefixName xml:lang='en'>pico</PrefixName>
|
653
|
+
<PrefixSymbol type='ASCII'>p</PrefixSymbol>
|
654
|
+
<PrefixSymbol type='unicode'>p</PrefixSymbol>
|
655
|
+
<PrefixSymbol type='LaTeX'>p</PrefixSymbol>
|
656
|
+
<PrefixSymbol type='HTML'>p</PrefixSymbol>
|
657
|
+
</Prefix>
|
658
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
659
|
+
<mrow xref='NISTp10_1'>
|
660
|
+
<mi mathvariant='normal'>da</mi>
|
661
|
+
</mrow>
|
662
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='1' xml:id='NISTp10_1'>
|
663
|
+
<PrefixName xml:lang='en'>deka</PrefixName>
|
664
|
+
<PrefixSymbol type='ASCII'>da</PrefixSymbol>
|
665
|
+
<PrefixSymbol type='unicode'>da</PrefixSymbol>
|
666
|
+
<PrefixSymbol type='LaTeX'>da</PrefixSymbol>
|
667
|
+
<PrefixSymbol type='HTML'>da</PrefixSymbol>
|
668
|
+
</Prefix>
|
669
|
+
</math>
|
670
670
|
OUTPUT
|
671
671
|
end
|
672
672
|
|
673
673
|
it "deals with HTML entities in UnitsDB" do
|
674
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
675
|
-
|
676
|
-
INPUT
|
677
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
678
|
-
<mrow xref='NISTp10_-6'>
|
679
|
-
<mi mathvariant='normal'>µ</mi>
|
680
|
-
</mrow>
|
681
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-6' xml:id='NISTp10_-6'>
|
682
|
-
<PrefixName xml:lang='en'>micro</PrefixName>
|
683
|
-
<PrefixSymbol type='ASCII'>u</PrefixSymbol>
|
684
|
-
<PrefixSymbol type='unicode'>μ</PrefixSymbol>
|
685
|
-
<PrefixSymbol type='LaTeX'>$mu$</PrefixSymbol>
|
686
|
-
<PrefixSymbol type='HTML'>µ</PrefixSymbol>
|
687
|
-
</Prefix>
|
688
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd2'>
|
689
|
-
<Mass symbol='M' powerNumerator='1'/>
|
690
|
-
</Dimension>
|
691
|
-
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq2' dimensionURL='#NISTd2' quantityType='base'>
|
692
|
-
<QuantityName xml:lang='en-US'>mass</QuantityName>
|
693
|
-
</Quantity>
|
694
|
-
<mo>+</mo>
|
695
|
-
<mrow xref='U_um'>
|
696
|
-
<mi mathvariant='normal'>µm</mi>
|
697
|
-
</mrow>
|
698
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_um' dimensionURL='#NISTd1'>
|
699
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
700
|
-
<UnitName xml:lang='en'>um</UnitName>
|
701
|
-
<UnitSymbol type='HTML'>um</UnitSymbol>
|
702
|
-
<UnitSymbol type='MathML'>
|
674
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
675
|
+
"unitsml(u-)" + "unitsml(um)"
|
676
|
+
INPUT
|
703
677
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
704
|
-
<mrow>
|
678
|
+
<mrow xref='NISTp10_-6'>
|
679
|
+
<mi mathvariant='normal'>µ</mi>
|
680
|
+
</mrow>
|
681
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-6' xml:id='NISTp10_-6'>
|
682
|
+
<PrefixName xml:lang='en'>micro</PrefixName>
|
683
|
+
<PrefixSymbol type='ASCII'>u</PrefixSymbol>
|
684
|
+
<PrefixSymbol type='unicode'>μ</PrefixSymbol>
|
685
|
+
<PrefixSymbol type='LaTeX'>$mu$</PrefixSymbol>
|
686
|
+
<PrefixSymbol type='HTML'>µ</PrefixSymbol>
|
687
|
+
</Prefix>
|
688
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd2'>
|
689
|
+
<Mass symbol='M' powerNumerator='1'/>
|
690
|
+
</Dimension>
|
691
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq2' dimensionURL='#NISTd2' quantityType='base'>
|
692
|
+
<QuantityName xml:lang='en-US'>mass</QuantityName>
|
693
|
+
</Quantity>
|
694
|
+
<mo>+</mo>
|
695
|
+
<mrow xref='U_um'>
|
705
696
|
<mi mathvariant='normal'>µm</mi>
|
706
697
|
</mrow>
|
698
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_um' dimensionURL='#NISTd1'>
|
699
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
700
|
+
<UnitName xml:lang='en'>um</UnitName>
|
701
|
+
<UnitSymbol type='HTML'>um</UnitSymbol>
|
702
|
+
<UnitSymbol type='MathML'>
|
703
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
704
|
+
<mrow>
|
705
|
+
<mi mathvariant='normal'>µm</mi>
|
706
|
+
</mrow>
|
707
|
+
</math>
|
708
|
+
</UnitSymbol>
|
709
|
+
<RootUnits>
|
710
|
+
<EnumeratedRootUnit unit='meter' prefix='u'/>
|
711
|
+
</RootUnits>
|
712
|
+
</Unit>
|
713
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
714
|
+
<Length symbol='L' powerNumerator='1'/>
|
715
|
+
</Dimension>
|
707
716
|
</math>
|
708
|
-
</UnitSymbol>
|
709
|
-
<RootUnits>
|
710
|
-
<EnumeratedRootUnit unit='meter' prefix='u'/>
|
711
|
-
</RootUnits>
|
712
|
-
</Unit>
|
713
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
714
|
-
<Length symbol='L' powerNumerator='1'/>
|
715
|
-
</Dimension>
|
716
|
-
</math>
|
717
717
|
OUTPUT
|
718
718
|
end
|
719
719
|
|
720
720
|
it "deals with units division" do
|
721
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
722
|
-
|
723
|
-
INPUT
|
724
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
<mi mathvariant='normal'>A</mi>
|
729
|
-
<mo>⋅</mo>
|
730
|
-
<msup>
|
731
|
-
<mrow>
|
732
|
-
<mi mathvariant='normal'>C</mi>
|
733
|
-
</mrow>
|
734
|
-
<mrow>
|
735
|
-
<mn>3</mn>
|
736
|
-
</mrow>
|
737
|
-
</msup>
|
738
|
-
</mrow>
|
739
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_A.C3' dimensionURL='#D_M3I4'>
|
740
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
741
|
-
<UnitName xml:lang='en'>A*C^3</UnitName>
|
742
|
-
<UnitSymbol type='HTML'>
|
743
|
-
A⋅C
|
744
|
-
<sup>3</sup>
|
745
|
-
</UnitSymbol>
|
746
|
-
<UnitSymbol type='MathML'>
|
747
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
748
|
-
<mrow>
|
721
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
722
|
+
9 "unitsml(A*C^3)" + 13 "unitsml(A/C^-3)" + 2 "unitsml(J/kg*K)"
|
723
|
+
INPUT
|
724
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
725
|
+
<mn>9</mn>
|
726
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
727
|
+
<mrow xref='U_A.C3'>
|
749
728
|
<mi mathvariant='normal'>A</mi>
|
750
729
|
<mo>⋅</mo>
|
751
730
|
<msup>
|
@@ -757,215 +736,217 @@ INPUT
|
|
757
736
|
</mrow>
|
758
737
|
</msup>
|
759
738
|
</mrow>
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
<
|
789
|
-
<
|
790
|
-
<
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
</
|
797
|
-
<
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
739
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_A.C3' dimensionURL='#D_M3I4'>
|
740
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
741
|
+
<UnitName xml:lang='en'>A*C^3</UnitName>
|
742
|
+
<UnitSymbol type='HTML'>
|
743
|
+
A⋅C
|
744
|
+
<sup>3</sup>
|
745
|
+
</UnitSymbol>
|
746
|
+
<UnitSymbol type='MathML'>
|
747
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
748
|
+
<mrow>
|
749
|
+
<mi mathvariant='normal'>A</mi>
|
750
|
+
<mo>⋅</mo>
|
751
|
+
<msup>
|
752
|
+
<mrow>
|
753
|
+
<mi mathvariant='normal'>C</mi>
|
754
|
+
</mrow>
|
755
|
+
<mrow>
|
756
|
+
<mn>3</mn>
|
757
|
+
</mrow>
|
758
|
+
</msup>
|
759
|
+
</mrow>
|
760
|
+
</math>
|
761
|
+
</UnitSymbol>
|
762
|
+
<RootUnits>
|
763
|
+
<EnumeratedRootUnit unit='ampere'/>
|
764
|
+
<EnumeratedRootUnit unit='coulomb' powerNumerator='3'/>
|
765
|
+
</RootUnits>
|
766
|
+
</Unit>
|
767
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='D_M3I4'>
|
768
|
+
<Mass symbol='M' powerNumerator='3'/>
|
769
|
+
<ElectricCurrent symbol='I' powerNumerator='4'/>
|
770
|
+
</Dimension>
|
771
|
+
<mo>+</mo>
|
772
|
+
<mn>13</mn>
|
773
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
774
|
+
<mrow xref='U_A/C-3'>
|
775
|
+
<mi mathvariant='normal'>A</mi>
|
776
|
+
<mo>/</mo>
|
777
|
+
<msup>
|
778
|
+
<mrow>
|
779
|
+
<mi mathvariant='normal'>C</mi>
|
780
|
+
</mrow>
|
781
|
+
<mrow>
|
782
|
+
<mo>−</mo>
|
783
|
+
<mn>3</mn>
|
784
|
+
</mrow>
|
785
|
+
</msup>
|
786
|
+
</mrow>
|
787
|
+
<mo>+</mo>
|
788
|
+
<mn>2</mn>
|
789
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
790
|
+
<mrow xref='U_J/kg.K'>
|
809
791
|
<mi mathvariant='normal'>J</mi>
|
792
|
+
<mo>/</mo>
|
793
|
+
<mi mathvariant='normal'>kg</mi>
|
810
794
|
<mo>⋅</mo>
|
811
|
-
<
|
812
|
-
<mrow>
|
813
|
-
<mi mathvariant='normal'>kg</mi>
|
814
|
-
</mrow>
|
815
|
-
<mrow>
|
816
|
-
<mo>−</mo>
|
817
|
-
<mn>1</mn>
|
818
|
-
</mrow>
|
819
|
-
</msup>
|
820
|
-
<mo>⋅</mo>
|
821
|
-
<msup>
|
822
|
-
<mrow>
|
823
|
-
<mi mathvariant='normal'>K</mi>
|
824
|
-
</mrow>
|
825
|
-
<mrow>
|
826
|
-
<mo>−</mo>
|
827
|
-
<mn>1</mn>
|
828
|
-
</mrow>
|
829
|
-
</msup>
|
795
|
+
<mi mathvariant='normal'>K</mi>
|
830
796
|
</mrow>
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
</
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
<
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
<
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
797
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu13.u27p10_3e-1/1.u5e-1/1' dimensionURL='#D_L2M0T-2Theta-1'>
|
798
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
799
|
+
<UnitName xml:lang='en'>joule per kilogram kelvin</UnitName>
|
800
|
+
<UnitSymbol type='HTML'>
|
801
|
+
J⋅kg
|
802
|
+
<sup>−1</sup>
|
803
|
+
⋅K
|
804
|
+
<sup>−1</sup>
|
805
|
+
</UnitSymbol>
|
806
|
+
<UnitSymbol type='MathML'>
|
807
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
808
|
+
<mrow>
|
809
|
+
<mi mathvariant='normal'>J</mi>
|
810
|
+
<mo>⋅</mo>
|
811
|
+
<msup>
|
812
|
+
<mrow>
|
813
|
+
<mi mathvariant='normal'>kg</mi>
|
814
|
+
</mrow>
|
815
|
+
<mrow>
|
816
|
+
<mo>−</mo>
|
817
|
+
<mn>1</mn>
|
818
|
+
</mrow>
|
819
|
+
</msup>
|
820
|
+
<mo>⋅</mo>
|
821
|
+
<msup>
|
822
|
+
<mrow>
|
823
|
+
<mi mathvariant='normal'>K</mi>
|
824
|
+
</mrow>
|
825
|
+
<mrow>
|
826
|
+
<mo>−</mo>
|
827
|
+
<mn>1</mn>
|
828
|
+
</mrow>
|
829
|
+
</msup>
|
830
|
+
</mrow>
|
831
|
+
</math>
|
832
|
+
</UnitSymbol>
|
833
|
+
<RootUnits>
|
834
|
+
<EnumeratedRootUnit unit='joule'/>
|
835
|
+
<EnumeratedRootUnit unit='gram' prefix='k' powerNumerator='-1'/>
|
836
|
+
<EnumeratedRootUnit unit='kelvin' powerNumerator='-1'/>
|
837
|
+
</RootUnits>
|
838
|
+
</Unit>
|
839
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
840
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
841
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
842
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
843
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
844
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
845
|
+
</Prefix>
|
846
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd40'>
|
847
|
+
<Length symbol='L' powerNumerator='2'/>
|
848
|
+
<Time symbol='T' powerNumerator='-2'/>
|
849
|
+
<ThermodynamicTemperature symbol='Theta' powerNumerator='-1'/>
|
850
|
+
</Dimension>
|
851
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='D_L2M0T-2Theta-1'>
|
852
|
+
<Length symbol='L' powerNumerator='2'/>
|
853
|
+
<Mass symbol='M' powerNumerator='0'/>
|
854
|
+
<Time symbol='T' powerNumerator='-2'/>
|
855
|
+
<ThermodynamicTemperature symbol='Theta' powerNumerator='-1'/>
|
856
|
+
</Dimension>
|
857
|
+
</math>
|
858
|
+
OUTPUT
|
859
859
|
end
|
860
860
|
|
861
861
|
it "converts MathML to MatML + UnitsML" do
|
862
862
|
input = <<~INPUT
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
</math>
|
863
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
864
|
+
<mn>32</mn>
|
865
|
+
<mo>+</mo>
|
866
|
+
<mn>5</mn>
|
867
|
+
<mo>×</mo>
|
868
|
+
<mn>7</mn>
|
869
|
+
<mtext>unitsml(kg^-2)</mtext>
|
870
|
+
</math>
|
871
871
|
INPUT
|
872
872
|
output = <<~OUTPUT
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
873
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
874
|
+
<mn>32</mn>
|
875
|
+
<mo>+</mo>
|
876
|
+
<mn>5</mn>
|
877
|
+
<mo>×</mo>
|
878
|
+
<mn>7</mn>
|
879
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
880
|
+
<mrow xref='U_kg-2'>
|
881
|
+
<msup>
|
882
|
+
<mrow>
|
883
|
+
<mi mathvariant='normal'>kg</mi>
|
884
|
+
</mrow>
|
885
|
+
<mrow>
|
886
|
+
<mo>−</mo>
|
887
|
+
<mn>2</mn>
|
888
|
+
</mrow>
|
889
|
+
</msup>
|
890
|
+
</mrow>
|
891
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg-2' dimensionURL='#D_M-2'>
|
892
|
+
<UnitSystem name='SI' type='SI_base' xml:lang='en-US'/>
|
893
|
+
<UnitName xml:lang='en'>kg^-2</UnitName>
|
894
|
+
<UnitSymbol type='HTML'>
|
895
|
+
kg
|
896
|
+
<sup>−2</sup>
|
897
|
+
</UnitSymbol>
|
898
|
+
<UnitSymbol type='MathML'>
|
899
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
885
900
|
<mrow>
|
886
|
-
<
|
887
|
-
|
901
|
+
<msup>
|
902
|
+
<mrow>
|
903
|
+
<mi mathvariant='normal'>kg</mi>
|
904
|
+
</mrow>
|
905
|
+
<mrow>
|
906
|
+
<mo>−</mo>
|
907
|
+
<mn>2</mn>
|
908
|
+
</mrow>
|
909
|
+
</msup>
|
888
910
|
</mrow>
|
889
|
-
</
|
890
|
-
</
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
</UnitSymbol>
|
913
|
-
<RootUnits>
|
914
|
-
<EnumeratedRootUnit unit='gram' prefix='k' powerNumerator='-2'/>
|
915
|
-
</RootUnits>
|
916
|
-
</Unit>
|
917
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
918
|
-
<PrefixName xml:lang='en'>kilo</PrefixName>
|
919
|
-
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
920
|
-
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
921
|
-
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
922
|
-
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
923
|
-
</Prefix>
|
924
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='D_M-2'>
|
925
|
-
<Mass symbol='M' powerNumerator='-2'/>
|
926
|
-
</Dimension>
|
927
|
-
</math>
|
928
|
-
OUTPUT
|
929
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new().MathML2UnitsML(input).to_xml)).to be_equivalent_to xmlpp(output)
|
930
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new().MathML2UnitsML(Nokogiri::XML(input)).to_xml)).to be_equivalent_to xmlpp(output)
|
911
|
+
</math>
|
912
|
+
</UnitSymbol>
|
913
|
+
<RootUnits>
|
914
|
+
<EnumeratedRootUnit unit='gram' prefix='k' powerNumerator='-2'/>
|
915
|
+
</RootUnits>
|
916
|
+
</Unit>
|
917
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
918
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
919
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
920
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
921
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
922
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
923
|
+
</Prefix>
|
924
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='D_M-2'>
|
925
|
+
<Mass symbol='M' powerNumerator='-2'/>
|
926
|
+
</Dimension>
|
927
|
+
</math>
|
928
|
+
OUTPUT
|
929
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
930
|
+
.MathML2UnitsML(input).to_xml)).to be_equivalent_to xmlpp(output)
|
931
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
932
|
+
.MathML2UnitsML(Nokogiri::XML(input)).to_xml))
|
933
|
+
.to be_equivalent_to xmlpp(output)
|
931
934
|
end
|
932
935
|
|
933
936
|
it "raises error for illegal unit" do
|
934
|
-
expect{xmlpp(Asciimath2UnitsML::Conv.new
|
935
|
-
|
937
|
+
expect { xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT)) }.to raise_error(Rsec::SyntaxError)
|
938
|
+
12 "unitsml(que?)"
|
936
939
|
INPUT
|
937
940
|
end
|
938
941
|
|
939
942
|
it "initialises multiplier" do
|
940
943
|
expect(xmlpp(Asciimath2UnitsML::Conv.new(multiplier: "\u00d7").Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
941
|
-
1 "unitsml(kg*s^-2)"
|
944
|
+
1 "unitsml(kg*s^-2)"
|
942
945
|
INPUT
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
<mi mathvariant='normal'>kg</mi>
|
948
|
-
<mo>×</mo>
|
949
|
-
<msup>
|
950
|
-
<mrow>
|
951
|
-
<mi mathvariant='normal'>s</mi>
|
952
|
-
</mrow>
|
953
|
-
<mrow>
|
954
|
-
<mo>−</mo>
|
955
|
-
<mn>2</mn>
|
956
|
-
</mrow>
|
957
|
-
</msup>
|
958
|
-
</mrow>
|
959
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg.s-2' dimensionURL='#NISTd37'>
|
960
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
961
|
-
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
962
|
-
<UnitSymbol type='HTML'>
|
963
|
-
kg×s
|
964
|
-
<sup>−2</sup>
|
965
|
-
</UnitSymbol>
|
966
|
-
<UnitSymbol type='MathML'>
|
967
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
968
|
-
<mrow>
|
946
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
947
|
+
<mn>1</mn>
|
948
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
949
|
+
<mrow xref='U_kg.s-2'>
|
969
950
|
<mi mathvariant='normal'>kg</mi>
|
970
951
|
<mo>×</mo>
|
971
952
|
<msup>
|
@@ -978,116 +959,116 @@ OUTPUT
|
|
978
959
|
</mrow>
|
979
960
|
</msup>
|
980
961
|
</mrow>
|
962
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg.s-2' dimensionURL='#NISTd37'>
|
963
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
964
|
+
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
965
|
+
<UnitSymbol type='HTML'>
|
966
|
+
kg×s
|
967
|
+
<sup>−2</sup>
|
968
|
+
</UnitSymbol>
|
969
|
+
<UnitSymbol type='MathML'>
|
970
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
971
|
+
<mrow>
|
972
|
+
<mi mathvariant='normal'>kg</mi>
|
973
|
+
<mo>×</mo>
|
974
|
+
<msup>
|
975
|
+
<mrow>
|
976
|
+
<mi mathvariant='normal'>s</mi>
|
977
|
+
</mrow>
|
978
|
+
<mrow>
|
979
|
+
<mo>−</mo>
|
980
|
+
<mn>2</mn>
|
981
|
+
</mrow>
|
982
|
+
</msup>
|
983
|
+
</mrow>
|
984
|
+
</math>
|
985
|
+
</UnitSymbol>
|
986
|
+
<RootUnits>
|
987
|
+
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
988
|
+
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
989
|
+
</RootUnits>
|
990
|
+
</Unit>
|
991
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
992
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
993
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
994
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
995
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
996
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
997
|
+
</Prefix>
|
998
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd37'>
|
999
|
+
<Mass symbol='M' powerNumerator='1'/>
|
1000
|
+
<Time symbol='T' powerNumerator='-2'/>
|
1001
|
+
</Dimension>
|
981
1002
|
</math>
|
982
|
-
</UnitSymbol>
|
983
|
-
<RootUnits>
|
984
|
-
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
985
|
-
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
986
|
-
</RootUnits>
|
987
|
-
</Unit>
|
988
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
989
|
-
<PrefixName xml:lang='en'>kilo</PrefixName>
|
990
|
-
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
991
|
-
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
992
|
-
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
993
|
-
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
994
|
-
</Prefix>
|
995
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd37'>
|
996
|
-
<Mass symbol='M' powerNumerator='1'/>
|
997
|
-
<Time symbol='T' powerNumerator='-2'/>
|
998
|
-
</Dimension>
|
999
|
-
</math>
|
1000
1003
|
OUTPUT
|
1001
1004
|
expect(xmlpp(Asciimath2UnitsML::Conv.new(multiplier: :space).Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
1002
|
-
1 "unitsml(kg*s^-2)"
|
1005
|
+
1 "unitsml(kg*s^-2)"
|
1003
1006
|
INPUT
|
1004
|
-
|
1005
|
-
|
1006
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
1007
|
-
<mrow xref='U_kg.s-2'>
|
1008
|
-
<mi mathvariant='normal'>kg</mi>
|
1007
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1008
|
+
<mn>1</mn>
|
1009
1009
|
<mo rspace='thickmathspace'>⁢</mo>
|
1010
|
-
<
|
1011
|
-
<
|
1012
|
-
|
1013
|
-
|
1014
|
-
<mrow>
|
1015
|
-
<mo>−</mo>
|
1016
|
-
<mn>2</mn>
|
1017
|
-
</mrow>
|
1018
|
-
</msup>
|
1019
|
-
</mrow>
|
1020
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg.s-2' dimensionURL='#NISTd37'>
|
1021
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1022
|
-
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
1023
|
-
<UnitSymbol type='HTML'>
|
1024
|
-
kg s
|
1025
|
-
<sup>−2</sup>
|
1026
|
-
</UnitSymbol>
|
1027
|
-
<UnitSymbol type='MathML'>
|
1028
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1010
|
+
<mrow xref='U_kg.s-2'>
|
1011
|
+
<mi mathvariant='normal'>kg</mi>
|
1012
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1013
|
+
<msup>
|
1029
1014
|
<mrow>
|
1030
|
-
<mi mathvariant='normal'>
|
1031
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
1032
|
-
<msup>
|
1033
|
-
<mrow>
|
1034
|
-
<mi mathvariant='normal'>s</mi>
|
1035
|
-
</mrow>
|
1036
|
-
<mrow>
|
1037
|
-
<mo>−</mo>
|
1038
|
-
<mn>2</mn>
|
1039
|
-
</mrow>
|
1040
|
-
</msup>
|
1015
|
+
<mi mathvariant='normal'>s</mi>
|
1041
1016
|
</mrow>
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
</
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1017
|
+
<mrow>
|
1018
|
+
<mo>−</mo>
|
1019
|
+
<mn>2</mn>
|
1020
|
+
</mrow>
|
1021
|
+
</msup>
|
1022
|
+
</mrow>
|
1023
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg.s-2' dimensionURL='#NISTd37'>
|
1024
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1025
|
+
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
1026
|
+
<UnitSymbol type='HTML'>
|
1027
|
+
kg s
|
1028
|
+
<sup>−2</sup>
|
1029
|
+
</UnitSymbol>
|
1030
|
+
<UnitSymbol type='MathML'>
|
1031
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1032
|
+
<mrow>
|
1033
|
+
<mi mathvariant='normal'>kg</mi>
|
1034
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1035
|
+
<msup>
|
1036
|
+
<mrow>
|
1037
|
+
<mi mathvariant='normal'>s</mi>
|
1038
|
+
</mrow>
|
1039
|
+
<mrow>
|
1040
|
+
<mo>−</mo>
|
1041
|
+
<mn>2</mn>
|
1042
|
+
</mrow>
|
1043
|
+
</msup>
|
1044
|
+
</mrow>
|
1045
|
+
</math>
|
1046
|
+
</UnitSymbol>
|
1047
|
+
<RootUnits>
|
1048
|
+
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
1049
|
+
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
1050
|
+
</RootUnits>
|
1051
|
+
</Unit>
|
1052
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
1053
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
1054
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
1055
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
1056
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
1057
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
1058
|
+
</Prefix>
|
1059
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd37'>
|
1060
|
+
<Mass symbol='M' powerNumerator='1'/>
|
1061
|
+
<Time symbol='T' powerNumerator='-2'/>
|
1062
|
+
</Dimension>
|
1063
|
+
</math>
|
1061
1064
|
OUTPUT
|
1062
1065
|
expect(xmlpp(Asciimath2UnitsML::Conv.new(multiplier: :nospace).Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
1063
|
-
1 "unitsml(kg*s^-2)"
|
1066
|
+
1 "unitsml(kg*s^-2)"
|
1064
1067
|
INPUT
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
<mi mathvariant='normal'>kg</mi>
|
1070
|
-
<mo>⁢</mo>
|
1071
|
-
<msup>
|
1072
|
-
<mrow>
|
1073
|
-
<mi mathvariant='normal'>s</mi>
|
1074
|
-
</mrow>
|
1075
|
-
<mrow>
|
1076
|
-
<mo>−</mo>
|
1077
|
-
<mn>2</mn>
|
1078
|
-
</mrow>
|
1079
|
-
</msup>
|
1080
|
-
</mrow>
|
1081
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg.s-2' dimensionURL='#NISTd37'>
|
1082
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1083
|
-
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
1084
|
-
<UnitSymbol type='HTML'>
|
1085
|
-
kgs
|
1086
|
-
<sup>−2</sup>
|
1087
|
-
</UnitSymbol>
|
1088
|
-
<UnitSymbol type='MathML'>
|
1089
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1090
|
-
<mrow>
|
1068
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1069
|
+
<mn>1</mn>
|
1070
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1071
|
+
<mrow xref='U_kg.s-2'>
|
1091
1072
|
<mi mathvariant='normal'>kg</mi>
|
1092
1073
|
<mo>⁢</mo>
|
1093
1074
|
<msup>
|
@@ -1100,58 +1081,58 @@ OUTPUT
|
|
1100
1081
|
</mrow>
|
1101
1082
|
</msup>
|
1102
1083
|
</mrow>
|
1084
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_kg.s-2' dimensionURL='#NISTd37'>
|
1085
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1086
|
+
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
1087
|
+
<UnitSymbol type='HTML'>
|
1088
|
+
kgs
|
1089
|
+
<sup>−2</sup>
|
1090
|
+
</UnitSymbol>
|
1091
|
+
<UnitSymbol type='MathML'>
|
1092
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1093
|
+
<mrow>
|
1094
|
+
<mi mathvariant='normal'>kg</mi>
|
1095
|
+
<mo>⁢</mo>
|
1096
|
+
<msup>
|
1097
|
+
<mrow>
|
1098
|
+
<mi mathvariant='normal'>s</mi>
|
1099
|
+
</mrow>
|
1100
|
+
<mrow>
|
1101
|
+
<mo>−</mo>
|
1102
|
+
<mn>2</mn>
|
1103
|
+
</mrow>
|
1104
|
+
</msup>
|
1105
|
+
</mrow>
|
1106
|
+
</math>
|
1107
|
+
</UnitSymbol>
|
1108
|
+
<RootUnits>
|
1109
|
+
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
1110
|
+
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
1111
|
+
</RootUnits>
|
1112
|
+
</Unit>
|
1113
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
1114
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
1115
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
1116
|
+
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
1117
|
+
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
1118
|
+
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
1119
|
+
</Prefix>
|
1120
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd37'>
|
1121
|
+
<Mass symbol='M' powerNumerator='1'/>
|
1122
|
+
<Time symbol='T' powerNumerator='-2'/>
|
1123
|
+
</Dimension>
|
1103
1124
|
</math>
|
1104
|
-
</UnitSymbol>
|
1105
|
-
<RootUnits>
|
1106
|
-
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
1107
|
-
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
1108
|
-
</RootUnits>
|
1109
|
-
</Unit>
|
1110
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
1111
|
-
<PrefixName xml:lang='en'>kilo</PrefixName>
|
1112
|
-
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
1113
|
-
<PrefixSymbol type='unicode'>k</PrefixSymbol>
|
1114
|
-
<PrefixSymbol type='LaTeX'>k</PrefixSymbol>
|
1115
|
-
<PrefixSymbol type='HTML'>k</PrefixSymbol>
|
1116
|
-
</Prefix>
|
1117
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd37'>
|
1118
|
-
<Mass symbol='M' powerNumerator='1'/>
|
1119
|
-
<Time symbol='T' powerNumerator='-2'/>
|
1120
|
-
</Dimension>
|
1121
|
-
</math>
|
1122
1125
|
OUTPUT
|
1123
1126
|
end
|
1124
1127
|
|
1125
1128
|
it "deals with dimension decomposition with like units" do
|
1126
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
1127
|
-
|
1128
|
-
INPUT
|
1129
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
<mi mathvariant='normal'>mW</mi>
|
1134
|
-
<mo>⋅</mo>
|
1135
|
-
<msup>
|
1136
|
-
<mrow>
|
1137
|
-
<mi mathvariant='normal'>cm</mi>
|
1138
|
-
</mrow>
|
1139
|
-
<mrow>
|
1140
|
-
<mo>−</mo>
|
1141
|
-
<mn>2</mn>
|
1142
|
-
</mrow>
|
1143
|
-
</msup>
|
1144
|
-
</mrow>
|
1145
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_mW.cm-2'>
|
1146
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1147
|
-
<UnitName xml:lang='en'>mW*cm^-2</UnitName>
|
1148
|
-
<UnitSymbol type='HTML'>
|
1149
|
-
mW⋅cm
|
1150
|
-
<sup>−2</sup>
|
1151
|
-
</UnitSymbol>
|
1152
|
-
<UnitSymbol type='MathML'>
|
1153
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1154
|
-
<mrow>
|
1129
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
1130
|
+
9 "unitsml(mW*cm^(-2))"
|
1131
|
+
INPUT
|
1132
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1133
|
+
<mn>9</mn>
|
1134
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1135
|
+
<mrow xref='U_mW.cm-2'>
|
1155
1136
|
<mi mathvariant='normal'>mW</mi>
|
1156
1137
|
<mo>⋅</mo>
|
1157
1138
|
<msup>
|
@@ -1164,102 +1145,93 @@ INPUT
|
|
1164
1145
|
</mrow>
|
1165
1146
|
</msup>
|
1166
1147
|
</mrow>
|
1148
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_mW.cm-2'>
|
1149
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1150
|
+
<UnitName xml:lang='en'>mW*cm^-2</UnitName>
|
1151
|
+
<UnitSymbol type='HTML'>
|
1152
|
+
mW⋅cm
|
1153
|
+
<sup>−2</sup>
|
1154
|
+
</UnitSymbol>
|
1155
|
+
<UnitSymbol type='MathML'>
|
1156
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1157
|
+
<mrow>
|
1158
|
+
<mi mathvariant='normal'>mW</mi>
|
1159
|
+
<mo>⋅</mo>
|
1160
|
+
<msup>
|
1161
|
+
<mrow>
|
1162
|
+
<mi mathvariant='normal'>cm</mi>
|
1163
|
+
</mrow>
|
1164
|
+
<mrow>
|
1165
|
+
<mo>−</mo>
|
1166
|
+
<mn>2</mn>
|
1167
|
+
</mrow>
|
1168
|
+
</msup>
|
1169
|
+
</mrow>
|
1170
|
+
</math>
|
1171
|
+
</UnitSymbol>
|
1172
|
+
<RootUnits>
|
1173
|
+
<EnumeratedRootUnit unit='watt' prefix='m'/>
|
1174
|
+
<EnumeratedRootUnit unit='meter' prefix='c' powerNumerator='-2'/>
|
1175
|
+
</RootUnits>
|
1176
|
+
</Unit>
|
1177
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-3' xml:id='NISTp10_-3'>
|
1178
|
+
<PrefixName xml:lang='en'>milli</PrefixName>
|
1179
|
+
<PrefixSymbol type='ASCII'>m</PrefixSymbol>
|
1180
|
+
<PrefixSymbol type='unicode'>m</PrefixSymbol>
|
1181
|
+
<PrefixSymbol type='LaTeX'>m</PrefixSymbol>
|
1182
|
+
<PrefixSymbol type='HTML'>m</PrefixSymbol>
|
1183
|
+
</Prefix>
|
1184
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-2' xml:id='NISTp10_-2'>
|
1185
|
+
<PrefixName xml:lang='en'>centi</PrefixName>
|
1186
|
+
<PrefixSymbol type='ASCII'>c</PrefixSymbol>
|
1187
|
+
<PrefixSymbol type='unicode'>c</PrefixSymbol>
|
1188
|
+
<PrefixSymbol type='LaTeX'>c</PrefixSymbol>
|
1189
|
+
<PrefixSymbol type='HTML'>c</PrefixSymbol>
|
1190
|
+
</Prefix>
|
1167
1191
|
</math>
|
1168
|
-
|
1169
|
-
<RootUnits>
|
1170
|
-
<EnumeratedRootUnit unit='watt' prefix='m'/>
|
1171
|
-
<EnumeratedRootUnit unit='meter' prefix='c' powerNumerator='-2'/>
|
1172
|
-
</RootUnits>
|
1173
|
-
</Unit>
|
1174
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-3' xml:id='NISTp10_-3'>
|
1175
|
-
<PrefixName xml:lang='en'>milli</PrefixName>
|
1176
|
-
<PrefixSymbol type='ASCII'>m</PrefixSymbol>
|
1177
|
-
<PrefixSymbol type='unicode'>m</PrefixSymbol>
|
1178
|
-
<PrefixSymbol type='LaTeX'>m</PrefixSymbol>
|
1179
|
-
<PrefixSymbol type='HTML'>m</PrefixSymbol>
|
1180
|
-
</Prefix>
|
1181
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-2' xml:id='NISTp10_-2'>
|
1182
|
-
<PrefixName xml:lang='en'>centi</PrefixName>
|
1183
|
-
<PrefixSymbol type='ASCII'>c</PrefixSymbol>
|
1184
|
-
<PrefixSymbol type='unicode'>c</PrefixSymbol>
|
1185
|
-
<PrefixSymbol type='LaTeX'>c</PrefixSymbol>
|
1186
|
-
<PrefixSymbol type='HTML'>c</PrefixSymbol>
|
1187
|
-
</Prefix>
|
1188
|
-
</math>
|
1189
|
-
OUTPUT
|
1192
|
+
OUTPUT
|
1190
1193
|
end
|
1191
1194
|
|
1192
1195
|
it "deals with quantity input" do
|
1193
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
1194
|
-
|
1195
|
-
INPUT
|
1196
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1197
|
-
<mn>9</mn>
|
1198
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
1199
|
-
<mrow xref='U_NISTu1'>
|
1200
|
-
<mi mathvariant='normal'>m</mi>
|
1201
|
-
</mrow>
|
1202
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu1' dimensionURL='#NISTd1'>
|
1203
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1204
|
-
<UnitName xml:lang='en'>meter</UnitName>
|
1205
|
-
<UnitSymbol type='HTML'>m</UnitSymbol>
|
1206
|
-
<UnitSymbol type='MathML'>
|
1196
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
1197
|
+
9 "unitsml(m, quantity: NISTq103)"
|
1198
|
+
INPUT
|
1207
1199
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1208
|
-
<
|
1200
|
+
<mn>9</mn>
|
1201
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1202
|
+
<mrow xref='U_NISTu1'>
|
1209
1203
|
<mi mathvariant='normal'>m</mi>
|
1210
1204
|
</mrow>
|
1205
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu1' dimensionURL='#NISTd1'>
|
1206
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1207
|
+
<UnitName xml:lang='en'>meter</UnitName>
|
1208
|
+
<UnitSymbol type='HTML'>m</UnitSymbol>
|
1209
|
+
<UnitSymbol type='MathML'>
|
1210
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1211
|
+
<mrow>
|
1212
|
+
<mi mathvariant='normal'>m</mi>
|
1213
|
+
</mrow>
|
1214
|
+
</math>
|
1215
|
+
</UnitSymbol>
|
1216
|
+
</Unit>
|
1217
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
1218
|
+
<Length symbol='L' powerNumerator='1'/>
|
1219
|
+
</Dimension>
|
1220
|
+
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq103' dimensionURL='#NISTd1' quantityType='base'>
|
1221
|
+
<QuantityName xml:lang='en-US'>position vector</QuantityName>
|
1222
|
+
</Quantity>
|
1211
1223
|
</math>
|
1212
|
-
|
1213
|
-
|
1214
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
1215
|
-
<Length symbol='L' powerNumerator='1'/>
|
1216
|
-
</Dimension>
|
1217
|
-
<Quantity xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTq103' dimensionURL='#NISTd1' quantityType='base'>
|
1218
|
-
<QuantityName xml:lang='en-US'>position vector</QuantityName>
|
1219
|
-
</Quantity>
|
1220
|
-
</math>
|
1221
|
-
OUTPUT
|
1222
|
-
end
|
1224
|
+
OUTPUT
|
1225
|
+
end
|
1223
1226
|
|
1224
1227
|
it "deals with name input" do
|
1225
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
1226
|
-
|
1227
|
-
INPUT
|
1228
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
<msub>
|
1233
|
-
<mrow>
|
1234
|
-
<mi mathvariant='normal'>cal</mi>
|
1235
|
-
</mrow>
|
1236
|
-
<mrow>
|
1237
|
-
<mi mathvariant='normal'>th</mi>
|
1238
|
-
</mrow>
|
1239
|
-
</msub>
|
1240
|
-
<mo>/</mo>
|
1241
|
-
<msup>
|
1242
|
-
<mrow>
|
1243
|
-
<mi mathvariant='normal'>cm</mi>
|
1244
|
-
</mrow>
|
1245
|
-
<mrow>
|
1246
|
-
<mn>2</mn>
|
1247
|
-
</mrow>
|
1248
|
-
</msup>
|
1249
|
-
</mrow>
|
1250
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_cal_th.cm-2'>
|
1251
|
-
<UnitSystem name='not_SI' type='not_SI' xml:lang='en-US'/>
|
1252
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1253
|
-
<UnitName xml:lang='en'>langley</UnitName>
|
1254
|
-
<UnitSymbol type='HTML'>
|
1255
|
-
cal
|
1256
|
-
<sub>th</sub>
|
1257
|
-
⋅cm
|
1258
|
-
<sup>−2</sup>
|
1259
|
-
</UnitSymbol>
|
1260
|
-
<UnitSymbol type='MathML'>
|
1261
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1262
|
-
<mrow>
|
1228
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
1229
|
+
9 "unitsml(cal_th/cm^2, name: langley)"
|
1230
|
+
INPUT
|
1231
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1232
|
+
<mn>9</mn>
|
1233
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1234
|
+
<mrow xref='U_cal_th/cm2'>
|
1263
1235
|
<msub>
|
1264
1236
|
<mrow>
|
1265
1237
|
<mi mathvariant='normal'>cal</mi>
|
@@ -1268,158 +1240,167 @@ INPUT
|
|
1268
1240
|
<mi mathvariant='normal'>th</mi>
|
1269
1241
|
</mrow>
|
1270
1242
|
</msub>
|
1271
|
-
<mo
|
1243
|
+
<mo>/</mo>
|
1272
1244
|
<msup>
|
1273
1245
|
<mrow>
|
1274
1246
|
<mi mathvariant='normal'>cm</mi>
|
1275
1247
|
</mrow>
|
1276
1248
|
<mrow>
|
1277
|
-
<mo>−</mo>
|
1278
1249
|
<mn>2</mn>
|
1279
1250
|
</mrow>
|
1280
1251
|
</msup>
|
1281
1252
|
</mrow>
|
1253
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_cal_th.cm-2'>
|
1254
|
+
<UnitSystem name='not_SI' type='not_SI' xml:lang='en-US'/>
|
1255
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1256
|
+
<UnitName xml:lang='en'>langley</UnitName>
|
1257
|
+
<UnitSymbol type='HTML'>
|
1258
|
+
cal
|
1259
|
+
<sub>th</sub>
|
1260
|
+
⋅cm
|
1261
|
+
<sup>−2</sup>
|
1262
|
+
</UnitSymbol>
|
1263
|
+
<UnitSymbol type='MathML'>
|
1264
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1265
|
+
<mrow>
|
1266
|
+
<msub>
|
1267
|
+
<mrow>
|
1268
|
+
<mi mathvariant='normal'>cal</mi>
|
1269
|
+
</mrow>
|
1270
|
+
<mrow>
|
1271
|
+
<mi mathvariant='normal'>th</mi>
|
1272
|
+
</mrow>
|
1273
|
+
</msub>
|
1274
|
+
<mo>⋅</mo>
|
1275
|
+
<msup>
|
1276
|
+
<mrow>
|
1277
|
+
<mi mathvariant='normal'>cm</mi>
|
1278
|
+
</mrow>
|
1279
|
+
<mrow>
|
1280
|
+
<mo>−</mo>
|
1281
|
+
<mn>2</mn>
|
1282
|
+
</mrow>
|
1283
|
+
</msup>
|
1284
|
+
</mrow>
|
1285
|
+
</math>
|
1286
|
+
</UnitSymbol>
|
1287
|
+
<RootUnits>
|
1288
|
+
<EnumeratedRootUnit unit='thermochemical calorie'/>
|
1289
|
+
<EnumeratedRootUnit unit='meter' prefix='c' powerNumerator='-2'/>
|
1290
|
+
</RootUnits>
|
1291
|
+
</Unit>
|
1292
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-2' xml:id='NISTp10_-2'>
|
1293
|
+
<PrefixName xml:lang='en'>centi</PrefixName>
|
1294
|
+
<PrefixSymbol type='ASCII'>c</PrefixSymbol>
|
1295
|
+
<PrefixSymbol type='unicode'>c</PrefixSymbol>
|
1296
|
+
<PrefixSymbol type='LaTeX'>c</PrefixSymbol>
|
1297
|
+
<PrefixSymbol type='HTML'>c</PrefixSymbol>
|
1298
|
+
</Prefix>
|
1282
1299
|
</math>
|
1283
|
-
|
1284
|
-
|
1285
|
-
<EnumeratedRootUnit unit='thermochemical calorie'/>
|
1286
|
-
<EnumeratedRootUnit unit='meter' prefix='c' powerNumerator='-2'/>
|
1287
|
-
</RootUnits>
|
1288
|
-
</Unit>
|
1289
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-2' xml:id='NISTp10_-2'>
|
1290
|
-
<PrefixName xml:lang='en'>centi</PrefixName>
|
1291
|
-
<PrefixSymbol type='ASCII'>c</PrefixSymbol>
|
1292
|
-
<PrefixSymbol type='unicode'>c</PrefixSymbol>
|
1293
|
-
<PrefixSymbol type='LaTeX'>c</PrefixSymbol>
|
1294
|
-
<PrefixSymbol type='HTML'>c</PrefixSymbol>
|
1295
|
-
</Prefix>
|
1296
|
-
</math>
|
1297
|
-
OUTPUT
|
1298
|
-
end
|
1300
|
+
OUTPUT
|
1301
|
+
end
|
1299
1302
|
|
1300
|
-
|
1301
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
1302
|
-
|
1303
|
-
INPUT
|
1304
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1305
|
-
<mn>9</mn>
|
1306
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
1307
|
-
<mrow xref='U_NISTu1'>
|
1308
|
-
<math>
|
1309
|
-
<mi mathvariant='normal'>L</mi>
|
1310
|
-
<mi mathvariant='normal'>a</mi>
|
1311
|
-
</math>
|
1312
|
-
</mrow>
|
1313
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu1' dimensionURL='#NISTd1'>
|
1314
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1315
|
-
<UnitName xml:lang='en'>meter</UnitName>
|
1316
|
-
<UnitSymbol type='HTML'>m</UnitSymbol>
|
1317
|
-
<UnitSymbol type='MathML'>
|
1303
|
+
it "deals with symbol input" do
|
1304
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
1305
|
+
9 "unitsml(m, symbol: La)" + 10 "unitsml(cm*s^-2, symbol: cm cdot s^-2)"
|
1306
|
+
INPUT
|
1318
1307
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1319
|
-
<
|
1320
|
-
|
1308
|
+
<mn>9</mn>
|
1309
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1310
|
+
<mrow xref='U_NISTu1'>
|
1311
|
+
<math>
|
1312
|
+
<mi mathvariant='normal'>L</mi>
|
1313
|
+
<mi mathvariant='normal'>a</mi>
|
1314
|
+
</math>
|
1321
1315
|
</mrow>
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
<
|
1338
|
-
|
1339
|
-
|
1340
|
-
<mrow>
|
1341
|
-
<
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1356
|
-
<mrow>
|
1357
|
-
<mi mathvariant='normal'>cm</mi>
|
1358
|
-
<mo>⋅</mo>
|
1359
|
-
<msup>
|
1360
|
-
<mrow>
|
1361
|
-
<mi mathvariant='normal'>s</mi>
|
1362
|
-
</mrow>
|
1363
|
-
<mrow>
|
1364
|
-
<mo>−</mo>
|
1365
|
-
<mn>2</mn>
|
1366
|
-
</mrow>
|
1367
|
-
</msup>
|
1316
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_NISTu1' dimensionURL='#NISTd1'>
|
1317
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1318
|
+
<UnitName xml:lang='en'>meter</UnitName>
|
1319
|
+
<UnitSymbol type='HTML'>m</UnitSymbol>
|
1320
|
+
<UnitSymbol type='MathML'>
|
1321
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1322
|
+
<mrow>
|
1323
|
+
<mi mathvariant='normal'>m</mi>
|
1324
|
+
</mrow>
|
1325
|
+
</math>
|
1326
|
+
</UnitSymbol>
|
1327
|
+
</Unit>
|
1328
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd1'>
|
1329
|
+
<Length symbol='L' powerNumerator='1'/>
|
1330
|
+
</Dimension>
|
1331
|
+
<mo>+</mo>
|
1332
|
+
<mn>10</mn>
|
1333
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1334
|
+
<mrow xref='U_cm.s-2'>
|
1335
|
+
<math>
|
1336
|
+
<mi mathvariant='normal'>c</mi>
|
1337
|
+
<mi mathvariant='normal'>m</mi>
|
1338
|
+
<mo>⋅</mo>
|
1339
|
+
<msup>
|
1340
|
+
<mrow>
|
1341
|
+
<mi mathvariant='normal'>s</mi>
|
1342
|
+
</mrow>
|
1343
|
+
<mrow>
|
1344
|
+
<mo>−</mo>
|
1345
|
+
</mrow>
|
1346
|
+
</msup>
|
1347
|
+
<mn>2</mn>
|
1348
|
+
</math>
|
1368
1349
|
</mrow>
|
1350
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_cm.s-2' dimensionURL='#NISTd28'>
|
1351
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1352
|
+
<UnitName xml:lang='en'>cm*s^-2</UnitName>
|
1353
|
+
<UnitSymbol type='HTML'>
|
1354
|
+
cm⋅s
|
1355
|
+
<sup>−2</sup>
|
1356
|
+
</UnitSymbol>
|
1357
|
+
<UnitSymbol type='MathML'>
|
1358
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1359
|
+
<mrow>
|
1360
|
+
<mi mathvariant='normal'>cm</mi>
|
1361
|
+
<mo>⋅</mo>
|
1362
|
+
<msup>
|
1363
|
+
<mrow>
|
1364
|
+
<mi mathvariant='normal'>s</mi>
|
1365
|
+
</mrow>
|
1366
|
+
<mrow>
|
1367
|
+
<mo>−</mo>
|
1368
|
+
<mn>2</mn>
|
1369
|
+
</mrow>
|
1370
|
+
</msup>
|
1371
|
+
</mrow>
|
1372
|
+
</math>
|
1373
|
+
</UnitSymbol>
|
1374
|
+
<RootUnits>
|
1375
|
+
<EnumeratedRootUnit unit='meter' prefix='c'/>
|
1376
|
+
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
1377
|
+
</RootUnits>
|
1378
|
+
</Unit>
|
1379
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-2' xml:id='NISTp10_-2'>
|
1380
|
+
<PrefixName xml:lang='en'>centi</PrefixName>
|
1381
|
+
<PrefixSymbol type='ASCII'>c</PrefixSymbol>
|
1382
|
+
<PrefixSymbol type='unicode'>c</PrefixSymbol>
|
1383
|
+
<PrefixSymbol type='LaTeX'>c</PrefixSymbol>
|
1384
|
+
<PrefixSymbol type='HTML'>c</PrefixSymbol>
|
1385
|
+
</Prefix>
|
1386
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd28'>
|
1387
|
+
<Length symbol='L' powerNumerator='1'/>
|
1388
|
+
<Time symbol='T' powerNumerator='-2'/>
|
1389
|
+
</Dimension>
|
1369
1390
|
</math>
|
1370
|
-
|
1371
|
-
|
1372
|
-
<EnumeratedRootUnit unit='meter' prefix='c'/>
|
1373
|
-
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
1374
|
-
</RootUnits>
|
1375
|
-
</Unit>
|
1376
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-2' xml:id='NISTp10_-2'>
|
1377
|
-
<PrefixName xml:lang='en'>centi</PrefixName>
|
1378
|
-
<PrefixSymbol type='ASCII'>c</PrefixSymbol>
|
1379
|
-
<PrefixSymbol type='unicode'>c</PrefixSymbol>
|
1380
|
-
<PrefixSymbol type='LaTeX'>c</PrefixSymbol>
|
1381
|
-
<PrefixSymbol type='HTML'>c</PrefixSymbol>
|
1382
|
-
</Prefix>
|
1383
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd28'>
|
1384
|
-
<Length symbol='L' powerNumerator='1'/>
|
1385
|
-
<Time symbol='T' powerNumerator='-2'/>
|
1386
|
-
</Dimension>
|
1387
|
-
</math>
|
1388
|
-
OUTPUT
|
1389
|
-
end
|
1391
|
+
OUTPUT
|
1392
|
+
end
|
1390
1393
|
|
1391
|
-
|
1392
|
-
expect(xmlpp(Asciimath2UnitsML::Conv.new
|
1393
|
-
|
1394
|
-
INPUT
|
1395
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1396
|
-
<mn>10</mn>
|
1397
|
-
<mo rspace='thickmathspace'>⁢</mo>
|
1398
|
-
<mrow xref='U_cm.s-2'>
|
1399
|
-
<mi mathvariant='normal'>cm</mi>
|
1400
|
-
<mo>xx</mo>
|
1401
|
-
<msup>
|
1402
|
-
<mrow>
|
1403
|
-
<mi mathvariant='normal'>s</mi>
|
1404
|
-
</mrow>
|
1405
|
-
<mrow>
|
1406
|
-
<mo>−</mo>
|
1407
|
-
<mn>2</mn>
|
1408
|
-
</mrow>
|
1409
|
-
</msup>
|
1410
|
-
</mrow>
|
1411
|
-
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_cm.s-2' dimensionURL='#NISTd28'>
|
1412
|
-
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1413
|
-
<UnitName xml:lang='en'>cm*s^-2</UnitName>
|
1414
|
-
<UnitSymbol type='HTML'>
|
1415
|
-
cm⋅s
|
1416
|
-
<sup>−2</sup>
|
1417
|
-
</UnitSymbol>
|
1418
|
-
<UnitSymbol type='MathML'>
|
1394
|
+
it "deals with multiplier input" do
|
1395
|
+
expect(xmlpp(Asciimath2UnitsML::Conv.new.Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
1396
|
+
10 "unitsml(cm*s^-2, multiplier: xx)"
|
1397
|
+
INPUT
|
1419
1398
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1420
|
-
<
|
1399
|
+
<mn>10</mn>
|
1400
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
1401
|
+
<mrow xref='U_cm.s-2'>
|
1421
1402
|
<mi mathvariant='normal'>cm</mi>
|
1422
|
-
<mo
|
1403
|
+
<mo>xx</mo>
|
1423
1404
|
<msup>
|
1424
1405
|
<mrow>
|
1425
1406
|
<mi mathvariant='normal'>s</mi>
|
@@ -1430,26 +1411,47 @@ INPUT
|
|
1430
1411
|
</mrow>
|
1431
1412
|
</msup>
|
1432
1413
|
</mrow>
|
1414
|
+
<Unit xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='U_cm.s-2' dimensionURL='#NISTd28'>
|
1415
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
1416
|
+
<UnitName xml:lang='en'>cm*s^-2</UnitName>
|
1417
|
+
<UnitSymbol type='HTML'>
|
1418
|
+
cm⋅s
|
1419
|
+
<sup>−2</sup>
|
1420
|
+
</UnitSymbol>
|
1421
|
+
<UnitSymbol type='MathML'>
|
1422
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1423
|
+
<mrow>
|
1424
|
+
<mi mathvariant='normal'>cm</mi>
|
1425
|
+
<mo>⋅</mo>
|
1426
|
+
<msup>
|
1427
|
+
<mrow>
|
1428
|
+
<mi mathvariant='normal'>s</mi>
|
1429
|
+
</mrow>
|
1430
|
+
<mrow>
|
1431
|
+
<mo>−</mo>
|
1432
|
+
<mn>2</mn>
|
1433
|
+
</mrow>
|
1434
|
+
</msup>
|
1435
|
+
</mrow>
|
1436
|
+
</math>
|
1437
|
+
</UnitSymbol>
|
1438
|
+
<RootUnits>
|
1439
|
+
<EnumeratedRootUnit unit='meter' prefix='c'/>
|
1440
|
+
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
1441
|
+
</RootUnits>
|
1442
|
+
</Unit>
|
1443
|
+
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-2' xml:id='NISTp10_-2'>
|
1444
|
+
<PrefixName xml:lang='en'>centi</PrefixName>
|
1445
|
+
<PrefixSymbol type='ASCII'>c</PrefixSymbol>
|
1446
|
+
<PrefixSymbol type='unicode'>c</PrefixSymbol>
|
1447
|
+
<PrefixSymbol type='LaTeX'>c</PrefixSymbol>
|
1448
|
+
<PrefixSymbol type='HTML'>c</PrefixSymbol>
|
1449
|
+
</Prefix>
|
1450
|
+
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd28'>
|
1451
|
+
<Length symbol='L' powerNumerator='1'/>
|
1452
|
+
<Time symbol='T' powerNumerator='-2'/>
|
1453
|
+
</Dimension>
|
1433
1454
|
</math>
|
1434
|
-
|
1435
|
-
|
1436
|
-
<EnumeratedRootUnit unit='meter' prefix='c'/>
|
1437
|
-
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
1438
|
-
</RootUnits>
|
1439
|
-
</Unit>
|
1440
|
-
<Prefix xmlns='https://schema.unitsml.org/unitsml/1.0' prefixBase='10' prefixPower='-2' xml:id='NISTp10_-2'>
|
1441
|
-
<PrefixName xml:lang='en'>centi</PrefixName>
|
1442
|
-
<PrefixSymbol type='ASCII'>c</PrefixSymbol>
|
1443
|
-
<PrefixSymbol type='unicode'>c</PrefixSymbol>
|
1444
|
-
<PrefixSymbol type='LaTeX'>c</PrefixSymbol>
|
1445
|
-
<PrefixSymbol type='HTML'>c</PrefixSymbol>
|
1446
|
-
</Prefix>
|
1447
|
-
<Dimension xmlns='https://schema.unitsml.org/unitsml/1.0' xml:id='NISTd28'>
|
1448
|
-
<Length symbol='L' powerNumerator='1'/>
|
1449
|
-
<Time symbol='T' powerNumerator='-2'/>
|
1450
|
-
</Dimension>
|
1451
|
-
</math>
|
1452
|
-
OUTPUT
|
1453
|
-
end
|
1454
|
-
|
1455
|
+
OUTPUT
|
1456
|
+
end
|
1455
1457
|
end
|