plurimath 0.8.25 → 0.8.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/plurimath/math/formula/mrow.rb +1 -1
- data/lib/plurimath/math/formula.rb +1 -1
- data/lib/plurimath/math/function/fenced.rb +1 -1
- data/lib/plurimath/math/function/none.rb +3 -0
- data/lib/plurimath/math/function/underset.rb +1 -1
- data/lib/plurimath/math/symbols/symbol.rb +1 -1
- data/lib/plurimath/mathml/parser.rb +46 -46
- data/lib/plurimath/mathml/utility/formula_transformation.rb +2 -0
- data/lib/plurimath/mathml/utility.rb +1 -1
- data/lib/plurimath/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 567734f98d50c880712b5f5e044b44698872fddb28f9a42d6db7f9be2c3d14f4
|
4
|
+
data.tar.gz: f070e5341608e4135e83c5715e2af06c849a56c28deeda6a3d69a6892af83d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf74d549f20a7d2af98744ebbf10e1c68c78b550e11a2b56c7a66f1fb4ea68313044987144b26403f91658201c3a0892520434b7b6d2b10745dc2962cd9b96c4
|
7
|
+
data.tar.gz: a11b93465a74fd63518cb9c2336fcf7a843f067e32018f701a8d838276881b54a214453d1d4c5568ac82b7bd06f471de83961a8dfebe15eacc610f8bb0879c38
|
@@ -1,11 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "unary_function"
|
4
|
+
require_relative "../../mathml/utility"
|
4
5
|
|
5
6
|
module Plurimath
|
6
7
|
module Math
|
7
8
|
module Function
|
8
9
|
class None < UnaryFunction
|
10
|
+
include Mathml::Utility
|
11
|
+
|
9
12
|
def to_asciimath(**); end
|
10
13
|
|
11
14
|
def to_latex(**); end
|
@@ -1,67 +1,67 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "constants"
|
4
|
+
require "mml"
|
4
5
|
|
5
6
|
module Plurimath
|
6
7
|
class Mathml
|
7
8
|
class Parser
|
9
|
+
CONFIGURATION = {
|
10
|
+
Mml::MathWithNilNamespace => Plurimath::Math::Formula,
|
11
|
+
Mml::MathWithNamespace => Plurimath::Math::Formula,
|
12
|
+
Mml::Mmultiscripts => Plurimath::Math::Function::Multiscript,
|
13
|
+
Mml::Mlabeledtr => Plurimath::Math::Function::Mlabeledtr,
|
14
|
+
Mml::Munderover => Plurimath::Math::Function::Underover,
|
15
|
+
Mml::Semantics => Plurimath::Math::Function::Semantics,
|
16
|
+
Mml::Mscarries => Plurimath::Math::Function::Scarries,
|
17
|
+
Mml::Mfraction => Plurimath::Math::Function::Frac,
|
18
|
+
Mml::Menclose => Plurimath::Math::Function::Menclose,
|
19
|
+
Mml::Mlongdiv => Plurimath::Math::Function::Longdiv,
|
20
|
+
Mml::Mphantom => Plurimath::Math::Function::Phantom,
|
21
|
+
Mml::Msubsup => Plurimath::Math::Function::PowerBase,
|
22
|
+
Mml::Msgroup => Plurimath::Math::Function::Msgroup,
|
23
|
+
Mml::Mpadded => Plurimath::Math::Function::Mpadded,
|
24
|
+
Mml::Mfenced => Plurimath::Math::Function::Fenced,
|
25
|
+
Mml::Mstack => Plurimath::Math::Function::Stackrel,
|
26
|
+
Mml::Munder => Plurimath::Math::Function::Underset,
|
27
|
+
Mml::Msline => Plurimath::Math::Function::Msline,
|
28
|
+
Mml::Merror => Plurimath::Math::Function::Merror,
|
29
|
+
Mml::Mtable => Plurimath::Math::Function::Table,
|
30
|
+
Mml::Mstyle => Plurimath::Math::Formula::Mstyle,
|
31
|
+
Mml::Mglyph => Plurimath::Math::Function::Mglyph,
|
32
|
+
Mml::Mover => Plurimath::Math::Function::Overset,
|
33
|
+
Mml::Msqrt => Plurimath::Math::Function::Sqrt,
|
34
|
+
Mml::Mroot => Plurimath::Math::Function::Root,
|
35
|
+
Mml::Mtext => Plurimath::Math::Function::Text,
|
36
|
+
Mml::Mfrac => Plurimath::Math::Function::Frac,
|
37
|
+
Mml::Msrow => Plurimath::Math::Formula,
|
38
|
+
Mml::Msup => Plurimath::Math::Function::Power,
|
39
|
+
Mml::Msub => Plurimath::Math::Function::Base,
|
40
|
+
Mml::None => Plurimath::Math::Function::None,
|
41
|
+
Mml::Mrow => Plurimath::Math::Formula::Mrow,
|
42
|
+
Mml::Mtd => Plurimath::Math::Function::Td,
|
43
|
+
Mml::Mtr => Plurimath::Math::Function::Tr,
|
44
|
+
Mml::Mi => Plurimath::Math::Symbols::Symbol,
|
45
|
+
Mml::Mo => Plurimath::Math::Symbols::Symbol,
|
46
|
+
Mml::Ms => Plurimath::Math::Function::Ms,
|
47
|
+
Mml::Mn => Plurimath::Math::Number,
|
48
|
+
}
|
8
49
|
attr_accessor :text
|
50
|
+
@@models_set = false
|
9
51
|
|
10
52
|
def initialize(text)
|
11
|
-
mml_config
|
53
|
+
mml_config unless @@models_set
|
12
54
|
@text = text
|
13
55
|
end
|
14
56
|
|
15
57
|
def parse
|
16
58
|
namespace_exist = text.split(">").first.include?(" xmlns=")
|
17
|
-
|
59
|
+
Mml.parse(text, namespace_exist: namespace_exist)
|
18
60
|
end
|
19
61
|
|
20
|
-
private
|
21
|
-
|
22
62
|
def mml_config
|
23
|
-
|
24
|
-
|
25
|
-
::Mml::Configuration.config = {
|
26
|
-
mmultiscripts: Plurimath::Math::Function::Multiscript,
|
27
|
-
mlabeledtr: Plurimath::Math::Function::Mlabeledtr,
|
28
|
-
munderover: Plurimath::Math::Function::Underover,
|
29
|
-
semantics: Plurimath::Math::Function::Semantics,
|
30
|
-
mscarries: Plurimath::Math::Function::Scarries,
|
31
|
-
mfraction: Plurimath::Math::Function::Frac,
|
32
|
-
menclose: Plurimath::Math::Function::Menclose,
|
33
|
-
mlongdiv: Plurimath::Math::Function::Longdiv,
|
34
|
-
mphantom: Plurimath::Math::Function::Phantom,
|
35
|
-
msubsup: Plurimath::Math::Function::PowerBase,
|
36
|
-
msgroup: Plurimath::Math::Function::Msgroup,
|
37
|
-
mpadded: Plurimath::Math::Function::Mpadded,
|
38
|
-
mfenced: Plurimath::Math::Function::Fenced,
|
39
|
-
mstack: Plurimath::Math::Function::Stackrel,
|
40
|
-
munder: Plurimath::Math::Function::Underset,
|
41
|
-
msline: Plurimath::Math::Function::Msline,
|
42
|
-
merror: Plurimath::Math::Function::Merror,
|
43
|
-
mtable: Plurimath::Math::Function::Table,
|
44
|
-
mstyle: Plurimath::Math::Formula::Mstyle,
|
45
|
-
mglyph: Plurimath::Math::Function::Mglyph,
|
46
|
-
mover: Plurimath::Math::Function::Overset,
|
47
|
-
msqrt: Plurimath::Math::Function::Sqrt,
|
48
|
-
mroot: Plurimath::Math::Function::Root,
|
49
|
-
mtext: Plurimath::Math::Function::Text,
|
50
|
-
mfrac: Plurimath::Math::Function::Frac,
|
51
|
-
msrow: Plurimath::Math::Formula,
|
52
|
-
msup: Plurimath::Math::Function::Power,
|
53
|
-
msub: Plurimath::Math::Function::Base,
|
54
|
-
none: Plurimath::Math::Function::None,
|
55
|
-
mrow: Plurimath::Math::Formula::Mrow,
|
56
|
-
math: Plurimath::Math::Formula,
|
57
|
-
mtd: Plurimath::Math::Function::Td,
|
58
|
-
mtr: Plurimath::Math::Function::Tr,
|
59
|
-
mi: Plurimath::Math::Symbols::Symbol,
|
60
|
-
mo: Plurimath::Math::Symbols::Symbol,
|
61
|
-
ms: Plurimath::Math::Function::Ms,
|
62
|
-
mn: Plurimath::Math::Number,
|
63
|
-
}
|
64
|
-
require "mml"
|
63
|
+
Mml::Configuration.custom_models = CONFIGURATION
|
64
|
+
@@models_set = true
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
data/lib/plurimath/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plurimath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ox
|