plurimath 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +354 -34
- data/Gemfile +2 -2
- data/README.adoc +49 -9
- data/lib/plurimath/deprecation.rb +2 -1
- data/lib/plurimath/errors/configuration_error.rb +5 -1
- data/lib/plurimath/errors/deprecation_error.rb +2 -1
- data/lib/plurimath/errors/invalid_number.rb +17 -0
- data/lib/plurimath/errors/unsupported_base.rb +18 -0
- data/lib/plurimath/errors/{formatter/unsupported_locale.rb → unsupported_locale.rb} +1 -1
- data/lib/plurimath/errors.rb +8 -0
- data/lib/plurimath/formatter/numbers/base_notation.rb +7 -2
- data/lib/plurimath/formatter/numbers/format_options.rb +123 -17
- data/lib/plurimath/formatter/numbers/fraction.rb +7 -16
- data/lib/plurimath/formatter/numbers/integer.rb +3 -0
- data/lib/plurimath/formatter/numbers/notation_renderer.rb +35 -6
- data/lib/plurimath/formatter/numbers/number_renderer.rb +16 -4
- data/lib/plurimath/formatter/numbers/precision_resolver.rb +16 -3
- data/lib/plurimath/formatter/numbers/sign_renderer.rb +2 -1
- data/lib/plurimath/formatter/numbers/significant.rb +4 -2
- data/lib/plurimath/formatter/numbers/source.rb +18 -3
- data/lib/plurimath/formatter/standard.rb +6 -0
- data/lib/plurimath/formatter/supported_locales.rb +1 -1
- data/lib/plurimath/formatter.rb +0 -2
- data/lib/plurimath/html/transform.rb +24 -12
- data/lib/plurimath/math/core.rb +17 -14
- data/lib/plurimath/math/function/overleftrightarrow.rb +2 -2
- data/lib/plurimath/math/number.rb +11 -1
- data/lib/plurimath/math.rb +4 -1
- data/lib/plurimath/number_formatter.rb +45 -4
- data/lib/plurimath/omml/formula_transformation.rb +2 -1
- data/lib/plurimath/omml/translator.rb +4 -1
- data/lib/plurimath/unicode_math/parse.rb +93 -53
- data/lib/plurimath/unicode_math/parser.rb +7 -4
- data/lib/plurimath/unicode_math/parsing_rules/absence_rules.rb +33 -21
- data/lib/plurimath/unicode_math/parsing_rules/common_rules.rb +28 -16
- data/lib/plurimath/unicode_math/parsing_rules/constants_rules.rb +18 -7
- data/lib/plurimath/unicode_math/parsing_rules/masked.rb +35 -15
- data/lib/plurimath/unicode_math/parsing_rules/sub_sup.rb +98 -72
- data/lib/plurimath/unicode_math/transform.rb +755 -468
- data/lib/plurimath/version.rb +1 -1
- data/lib/plurimath.rb +1 -0
- metadata +5 -4
- data/lib/plurimath/errors/formatter/unsupported_base.rb +0 -21
data/lib/plurimath/version.rb
CHANGED
data/lib/plurimath.rb
CHANGED
|
@@ -13,6 +13,7 @@ module Plurimath
|
|
|
13
13
|
autoload :Error, "plurimath/errors/error"
|
|
14
14
|
autoload :ConfigurationError, "plurimath/errors/configuration_error"
|
|
15
15
|
autoload :DeprecationError, "plurimath/errors/deprecation_error"
|
|
16
|
+
autoload :Errors, "plurimath/errors"
|
|
16
17
|
autoload :Formatter, "plurimath/formatter"
|
|
17
18
|
autoload :Html, "plurimath/html"
|
|
18
19
|
autoload :Latex, "plurimath/latex"
|
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.11.
|
|
4
|
+
version: 0.11.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bigdecimal
|
|
@@ -199,12 +199,13 @@ files:
|
|
|
199
199
|
- lib/plurimath/errors/configuration_error.rb
|
|
200
200
|
- lib/plurimath/errors/deprecation_error.rb
|
|
201
201
|
- lib/plurimath/errors/error.rb
|
|
202
|
-
- lib/plurimath/errors/
|
|
203
|
-
- lib/plurimath/errors/formatter/unsupported_locale.rb
|
|
202
|
+
- lib/plurimath/errors/invalid_number.rb
|
|
204
203
|
- lib/plurimath/errors/invalid_type_error.rb
|
|
205
204
|
- lib/plurimath/errors/omml/unsupported_node_error.rb
|
|
206
205
|
- lib/plurimath/errors/parse_error.rb
|
|
207
206
|
- lib/plurimath/errors/parse_option_error.rb
|
|
207
|
+
- lib/plurimath/errors/unsupported_base.rb
|
|
208
|
+
- lib/plurimath/errors/unsupported_locale.rb
|
|
208
209
|
- lib/plurimath/formatter.rb
|
|
209
210
|
- lib/plurimath/formatter/numbers.rb
|
|
210
211
|
- lib/plurimath/formatter/numbers/base.rb
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Plurimath
|
|
4
|
-
module Formatter
|
|
5
|
-
class UnsupportedBase < Plurimath::Error
|
|
6
|
-
def initialize(base, supported_bases)
|
|
7
|
-
@base = base
|
|
8
|
-
@supported = supported_bases.keys.map do |key|
|
|
9
|
-
key.to_s.inspect
|
|
10
|
-
end.join(", ")
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def to_s
|
|
14
|
-
<<~MESSAGE
|
|
15
|
-
[plurimath] Unsupported base `#{@base}` for number formatting.
|
|
16
|
-
[plurimath] The formatter `:base` option must be one of: #{@supported}.
|
|
17
|
-
MESSAGE
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|