plurimath 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +36 -0
  3. data/.rubocop.yml +2 -0
  4. data/lib/plurimath/asciimath/constants.rb +308 -0
  5. data/lib/plurimath/asciimath/parse.rb +87 -0
  6. data/lib/plurimath/asciimath/parser.rb +24 -0
  7. data/lib/plurimath/asciimath/transform.rb +304 -0
  8. data/lib/plurimath/asciimath.rb +16 -0
  9. data/lib/plurimath/html.rb +15 -0
  10. data/lib/plurimath/latex/constants.rb +1963 -0
  11. data/lib/plurimath/latex/parse.rb +105 -0
  12. data/lib/plurimath/latex/parser.rb +24 -0
  13. data/lib/plurimath/latex/transform.rb +298 -0
  14. data/lib/plurimath/latex.rb +15 -0
  15. data/lib/plurimath/math/formula.rb +43 -0
  16. data/lib/plurimath/math/function/abs.rb +12 -0
  17. data/lib/plurimath/math/function/arccos.rb +12 -0
  18. data/lib/plurimath/math/function/arcsin.rb +12 -0
  19. data/lib/plurimath/math/function/arctan.rb +12 -0
  20. data/lib/plurimath/math/function/bar.rb +16 -0
  21. data/lib/plurimath/math/function/base.rb +30 -0
  22. data/lib/plurimath/math/function/binary_function.rb +53 -0
  23. data/lib/plurimath/math/function/cancel.rb +12 -0
  24. data/lib/plurimath/math/function/ceil.rb +12 -0
  25. data/lib/plurimath/math/function/color.rb +23 -0
  26. data/lib/plurimath/math/function/cos.rb +12 -0
  27. data/lib/plurimath/math/function/cosh.rb +12 -0
  28. data/lib/plurimath/math/function/cot.rb +12 -0
  29. data/lib/plurimath/math/function/coth.rb +12 -0
  30. data/lib/plurimath/math/function/csc.rb +12 -0
  31. data/lib/plurimath/math/function/csch.rb +12 -0
  32. data/lib/plurimath/math/function/ddot.rb +12 -0
  33. data/lib/plurimath/math/function/deg.rb +12 -0
  34. data/lib/plurimath/math/function/det.rb +12 -0
  35. data/lib/plurimath/math/function/dim.rb +12 -0
  36. data/lib/plurimath/math/function/dot.rb +12 -0
  37. data/lib/plurimath/math/function/exp.rb +12 -0
  38. data/lib/plurimath/math/function/f.rb +12 -0
  39. data/lib/plurimath/math/function/fenced.rb +22 -0
  40. data/lib/plurimath/math/function/floor.rb +12 -0
  41. data/lib/plurimath/math/function/font_style.rb +45 -0
  42. data/lib/plurimath/math/function/frac.rb +23 -0
  43. data/lib/plurimath/math/function/g.rb +12 -0
  44. data/lib/plurimath/math/function/gcd.rb +12 -0
  45. data/lib/plurimath/math/function/glb.rb +12 -0
  46. data/lib/plurimath/math/function/hat.rb +12 -0
  47. data/lib/plurimath/math/function/hom.rb +12 -0
  48. data/lib/plurimath/math/function/inf.rb +18 -0
  49. data/lib/plurimath/math/function/int.rb +17 -0
  50. data/lib/plurimath/math/function/ker.rb +12 -0
  51. data/lib/plurimath/math/function/lcm.rb +12 -0
  52. data/lib/plurimath/math/function/left.rb +23 -0
  53. data/lib/plurimath/math/function/lg.rb +12 -0
  54. data/lib/plurimath/math/function/lim.rb +23 -0
  55. data/lib/plurimath/math/function/liminf.rb +12 -0
  56. data/lib/plurimath/math/function/limits.rb +19 -0
  57. data/lib/plurimath/math/function/limsup.rb +12 -0
  58. data/lib/plurimath/math/function/ln.rb +12 -0
  59. data/lib/plurimath/math/function/log.rb +23 -0
  60. data/lib/plurimath/math/function/lub.rb +12 -0
  61. data/lib/plurimath/math/function/max.rb +12 -0
  62. data/lib/plurimath/math/function/min.rb +12 -0
  63. data/lib/plurimath/math/function/mod.rb +23 -0
  64. data/lib/plurimath/math/function/norm.rb +15 -0
  65. data/lib/plurimath/math/function/obrace.rb +12 -0
  66. data/lib/plurimath/math/function/oint.rb +17 -0
  67. data/lib/plurimath/math/function/overset.rb +23 -0
  68. data/lib/plurimath/math/function/power.rb +30 -0
  69. data/lib/plurimath/math/function/power_base.rb +26 -0
  70. data/lib/plurimath/math/function/prod.rb +23 -0
  71. data/lib/plurimath/math/function/root.rb +22 -0
  72. data/lib/plurimath/math/function/sec.rb +12 -0
  73. data/lib/plurimath/math/function/sech.rb +12 -0
  74. data/lib/plurimath/math/function/sin.rb +12 -0
  75. data/lib/plurimath/math/function/sinh.rb +12 -0
  76. data/lib/plurimath/math/function/sqrt.rb +16 -0
  77. data/lib/plurimath/math/function/stackrel.rb +12 -0
  78. data/lib/plurimath/math/function/substack.rb +18 -0
  79. data/lib/plurimath/math/function/sum.rb +23 -0
  80. data/lib/plurimath/math/function/sup.rb +12 -0
  81. data/lib/plurimath/math/function/table.rb +42 -0
  82. data/lib/plurimath/math/function/tan.rb +12 -0
  83. data/lib/plurimath/math/function/tanh.rb +12 -0
  84. data/lib/plurimath/math/function/td.rb +27 -0
  85. data/lib/plurimath/math/function/ternary_function.rb +42 -0
  86. data/lib/plurimath/math/function/text.rb +32 -0
  87. data/lib/plurimath/math/function/tilde.rb +12 -0
  88. data/lib/plurimath/math/function/tr.rb +25 -0
  89. data/lib/plurimath/math/function/ubrace.rb +12 -0
  90. data/lib/plurimath/math/function/ul.rb +12 -0
  91. data/lib/plurimath/math/function/unary_function.rb +41 -0
  92. data/lib/plurimath/math/function/underover.rb +12 -0
  93. data/lib/plurimath/math/function/underset.rb +12 -0
  94. data/lib/plurimath/math/function/vec.rb +12 -0
  95. data/lib/plurimath/math/function.rb +3 -0
  96. data/lib/plurimath/math/number.rb +29 -0
  97. data/lib/plurimath/math/symbol.rb +34 -0
  98. data/lib/plurimath/math.rb +51 -0
  99. data/lib/plurimath/mathml/constants.rb +327 -0
  100. data/lib/plurimath/mathml/parse.rb +63 -0
  101. data/lib/plurimath/mathml/parser.rb +25 -0
  102. data/lib/plurimath/mathml/transform.rb +195 -0
  103. data/lib/plurimath/mathml.rb +16 -0
  104. data/lib/plurimath/omml.rb +15 -0
  105. data/lib/plurimath/unicode.rb +15 -0
  106. data/lib/plurimath/unitsml.rb +11 -0
  107. data/lib/plurimath/version.rb +3 -1
  108. data/lib/plurimath.rb +3 -5
  109. data/plurimath.gemspec +3 -3
  110. metadata +129 -11
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Plurimath
4
+ class Unicode
5
+ attr_accessor :text
6
+
7
+ def initialize(text)
8
+ @text = text
9
+ end
10
+
11
+ def to_formula
12
+ # TODO: Will be implemented soon
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Plurimath
4
+ class Unitsml
5
+ attr_accessor :text
6
+
7
+ def initialize(text)
8
+ @text = text
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Plurimath
2
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
3
5
  end
data/lib/plurimath.rb CHANGED
@@ -1,6 +1,4 @@
1
- require "plurimath/version"
1
+ # frozen_string_literal: true
2
2
 
3
- module Plurimath
4
- class Error < StandardError; end
5
- # Your code goes here...
6
- end
3
+ require_relative "plurimath/version"
4
+ require_relative "plurimath/math"
data/plurimath.gemspec CHANGED
@@ -8,14 +8,13 @@ Gem::Specification.new do |spec|
8
8
 
9
9
  spec.summary = 'Converts LaTeX math into MathML.'
10
10
  spec.description = 'Converts LaTeX math into MathML.'
11
- spec.homepage = 'https://github.com/plurimath/latexmath'
11
+ spec.homepage = 'https://github.com/plurimath/plurimath'
12
12
  spec.license = 'BSD-2-Clause'
13
13
 
14
14
  spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
- spec.metadata['source_code_uri'] = 'https://github.com/plurimath/latexmath'
18
- spec.metadata['changelog_uri'] = 'https://github.com/plurimath/latexmath/blob/master/CHANGELOG.md.'
17
+ spec.metadata['source_code_uri'] = 'https://github.com/plurimath/plurimath'
19
18
 
20
19
  # Specify which files should be added to the gem when it is released.
21
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -25,4 +24,5 @@ Gem::Specification.new do |spec|
25
24
  spec.bindir = "exe"
26
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
26
  spec.require_paths = ["lib"]
27
+ spec.add_dependency 'parslet'
28
28
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plurimath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-03 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: parslet
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: Converts LaTeX math into MathML.
14
28
  email:
15
29
  - open.source@ribose.com
@@ -17,7 +31,9 @@ executables: []
17
31
  extensions: []
18
32
  extra_rdoc_files: []
19
33
  files:
34
+ - ".github/workflows/test.yml"
20
35
  - ".gitignore"
36
+ - ".rubocop.yml"
21
37
  - CODE_OF_CONDUCT.md
22
38
  - Gemfile
23
39
  - README.md
@@ -25,16 +41,118 @@ files:
25
41
  - bin/console
26
42
  - bin/setup
27
43
  - lib/plurimath.rb
44
+ - lib/plurimath/asciimath.rb
45
+ - lib/plurimath/asciimath/constants.rb
46
+ - lib/plurimath/asciimath/parse.rb
47
+ - lib/plurimath/asciimath/parser.rb
48
+ - lib/plurimath/asciimath/transform.rb
49
+ - lib/plurimath/html.rb
50
+ - lib/plurimath/latex.rb
51
+ - lib/plurimath/latex/constants.rb
52
+ - lib/plurimath/latex/parse.rb
53
+ - lib/plurimath/latex/parser.rb
54
+ - lib/plurimath/latex/transform.rb
55
+ - lib/plurimath/math.rb
56
+ - lib/plurimath/math/formula.rb
57
+ - lib/plurimath/math/function.rb
58
+ - lib/plurimath/math/function/abs.rb
59
+ - lib/plurimath/math/function/arccos.rb
60
+ - lib/plurimath/math/function/arcsin.rb
61
+ - lib/plurimath/math/function/arctan.rb
62
+ - lib/plurimath/math/function/bar.rb
63
+ - lib/plurimath/math/function/base.rb
64
+ - lib/plurimath/math/function/binary_function.rb
65
+ - lib/plurimath/math/function/cancel.rb
66
+ - lib/plurimath/math/function/ceil.rb
67
+ - lib/plurimath/math/function/color.rb
68
+ - lib/plurimath/math/function/cos.rb
69
+ - lib/plurimath/math/function/cosh.rb
70
+ - lib/plurimath/math/function/cot.rb
71
+ - lib/plurimath/math/function/coth.rb
72
+ - lib/plurimath/math/function/csc.rb
73
+ - lib/plurimath/math/function/csch.rb
74
+ - lib/plurimath/math/function/ddot.rb
75
+ - lib/plurimath/math/function/deg.rb
76
+ - lib/plurimath/math/function/det.rb
77
+ - lib/plurimath/math/function/dim.rb
78
+ - lib/plurimath/math/function/dot.rb
79
+ - lib/plurimath/math/function/exp.rb
80
+ - lib/plurimath/math/function/f.rb
81
+ - lib/plurimath/math/function/fenced.rb
82
+ - lib/plurimath/math/function/floor.rb
83
+ - lib/plurimath/math/function/font_style.rb
84
+ - lib/plurimath/math/function/frac.rb
85
+ - lib/plurimath/math/function/g.rb
86
+ - lib/plurimath/math/function/gcd.rb
87
+ - lib/plurimath/math/function/glb.rb
88
+ - lib/plurimath/math/function/hat.rb
89
+ - lib/plurimath/math/function/hom.rb
90
+ - lib/plurimath/math/function/inf.rb
91
+ - lib/plurimath/math/function/int.rb
92
+ - lib/plurimath/math/function/ker.rb
93
+ - lib/plurimath/math/function/lcm.rb
94
+ - lib/plurimath/math/function/left.rb
95
+ - lib/plurimath/math/function/lg.rb
96
+ - lib/plurimath/math/function/lim.rb
97
+ - lib/plurimath/math/function/liminf.rb
98
+ - lib/plurimath/math/function/limits.rb
99
+ - lib/plurimath/math/function/limsup.rb
100
+ - lib/plurimath/math/function/ln.rb
101
+ - lib/plurimath/math/function/log.rb
102
+ - lib/plurimath/math/function/lub.rb
103
+ - lib/plurimath/math/function/max.rb
104
+ - lib/plurimath/math/function/min.rb
105
+ - lib/plurimath/math/function/mod.rb
106
+ - lib/plurimath/math/function/norm.rb
107
+ - lib/plurimath/math/function/obrace.rb
108
+ - lib/plurimath/math/function/oint.rb
109
+ - lib/plurimath/math/function/overset.rb
110
+ - lib/plurimath/math/function/power.rb
111
+ - lib/plurimath/math/function/power_base.rb
112
+ - lib/plurimath/math/function/prod.rb
113
+ - lib/plurimath/math/function/root.rb
114
+ - lib/plurimath/math/function/sec.rb
115
+ - lib/plurimath/math/function/sech.rb
116
+ - lib/plurimath/math/function/sin.rb
117
+ - lib/plurimath/math/function/sinh.rb
118
+ - lib/plurimath/math/function/sqrt.rb
119
+ - lib/plurimath/math/function/stackrel.rb
120
+ - lib/plurimath/math/function/substack.rb
121
+ - lib/plurimath/math/function/sum.rb
122
+ - lib/plurimath/math/function/sup.rb
123
+ - lib/plurimath/math/function/table.rb
124
+ - lib/plurimath/math/function/tan.rb
125
+ - lib/plurimath/math/function/tanh.rb
126
+ - lib/plurimath/math/function/td.rb
127
+ - lib/plurimath/math/function/ternary_function.rb
128
+ - lib/plurimath/math/function/text.rb
129
+ - lib/plurimath/math/function/tilde.rb
130
+ - lib/plurimath/math/function/tr.rb
131
+ - lib/plurimath/math/function/ubrace.rb
132
+ - lib/plurimath/math/function/ul.rb
133
+ - lib/plurimath/math/function/unary_function.rb
134
+ - lib/plurimath/math/function/underover.rb
135
+ - lib/plurimath/math/function/underset.rb
136
+ - lib/plurimath/math/function/vec.rb
137
+ - lib/plurimath/math/number.rb
138
+ - lib/plurimath/math/symbol.rb
139
+ - lib/plurimath/mathml.rb
140
+ - lib/plurimath/mathml/constants.rb
141
+ - lib/plurimath/mathml/parse.rb
142
+ - lib/plurimath/mathml/parser.rb
143
+ - lib/plurimath/mathml/transform.rb
144
+ - lib/plurimath/omml.rb
145
+ - lib/plurimath/unicode.rb
146
+ - lib/plurimath/unitsml.rb
28
147
  - lib/plurimath/version.rb
29
148
  - plurimath.gemspec
30
- homepage: https://github.com/plurimath/latexmath
149
+ homepage: https://github.com/plurimath/plurimath
31
150
  licenses:
32
151
  - BSD-2-Clause
33
152
  metadata:
34
- homepage_uri: https://github.com/plurimath/latexmath
35
- source_code_uri: https://github.com/plurimath/latexmath
36
- changelog_uri: https://github.com/plurimath/latexmath/blob/master/CHANGELOG.md.
37
- post_install_message:
153
+ homepage_uri: https://github.com/plurimath/plurimath
154
+ source_code_uri: https://github.com/plurimath/plurimath
155
+ post_install_message:
38
156
  rdoc_options: []
39
157
  require_paths:
40
158
  - lib
@@ -49,8 +167,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
167
  - !ruby/object:Gem::Version
50
168
  version: '0'
51
169
  requirements: []
52
- rubygems_version: 3.0.3
53
- signing_key:
170
+ rubygems_version: 3.1.2
171
+ signing_key:
54
172
  specification_version: 4
55
173
  summary: Converts LaTeX math into MathML.
56
174
  test_files: []