plurimath 0.8.4 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3de6f5d5b432c5dfdfe1d34a6c076ab653c71ab14a6db6ad3e49c29c3bfc9c48
4
- data.tar.gz: 1c7f1ab5baef71bc88d7e99f05be8be96f3ddcc66c8e6dc928b300ddc97f39d1
3
+ metadata.gz: c30796b1e8f3dc56d40ceef4b2514dadf60a951f55fabb89177abb2431333e62
4
+ data.tar.gz: 16f211f6fc509983f762d119e0f736cee4670295d24a14d16177f029c8a1d898
5
5
  SHA512:
6
- metadata.gz: 380e817bd0ec4fbe93d8699d9c789f7b0c2dc5d13ee0dc8a1f0a6295176d725ce900d8a225eb7ae918b39bb6cfb8d3b5c49cbe797fab43c7d4c2607337efe0cb
7
- data.tar.gz: 3a3149026c98c56d0afc90d30aace9bd0b861d69eb17195de927eeecf1151eb1a9ea39e2d1d7e9bb9bd98ab7aed58cf3aea98c4e663900b70f1d865b520686e2
6
+ metadata.gz: 01c6f282735448b7e776a76d7d3d458ba01276162cc999330125e20c1a7972d8c2aa18bdee3512256ab403a2beb0f605e0493e774f44077cc1da462e51895e33
7
+ data.tar.gz: e7a9152de4bcdd8aeb9ef01b78f12b38900d72f2fab51d8ba439dc1614f92ada6128c2225eaa8ed1f0d28e19e689fa1739725008422b090870b2927dfaf43358
@@ -109,6 +109,10 @@ module Plurimath
109
109
  def parens_symbols
110
110
  Utility.parens_hash(:asciimath).keys.delete_if { |sym| SKIP_INPUT_PARENS.include?(sym) }
111
111
  end
112
+
113
+ def absent_symbols
114
+ wrapper_symbols.concat(parens_symbols)
115
+ end
112
116
  end
113
117
  end
114
118
  end
@@ -5,7 +5,7 @@ module Plurimath
5
5
  class Asciimath
6
6
  class Parse < Parslet::Parser
7
7
  rule(:td) { expression.as(:td) }
8
- rule(:base) { arr_to_expression(Constants.wrapper_symbols, :symbol).absent? >> str("_") }
8
+ rule(:base) { arr_to_expression(Constants.absent_symbols, :symbol).absent? >> str("_") }
9
9
  rule(:power) { str("^") }
10
10
  rule(:space) { match(/\s+/) }
11
11
  rule(:comma) { (str(",") >> space?) }
@@ -3,10 +3,10 @@ module Plurimath
3
3
  module Symbols
4
4
  class Backslash < Symbol
5
5
  INPUT = {
6
- unicodemath: [["&#x5c;"], parsing_wrapper(["backslash"])],
7
- asciimath: [["backslash", "&#x5c;"]],
6
+ unicodemath: [["&#x5c;"], parsing_wrapper(["backslash", "\\"])],
7
+ asciimath: ["backslash", "&#x5c;", "\\"],
8
8
  mathml: ["&#x5c;"],
9
- latex: [["backslash", "&#x5c;"]],
9
+ latex: [["backslash", "&#x5c;"], parsing_wrapper(["\\"])],
10
10
  omml: ["&#x5c;"],
11
11
  html: ["&#x5c;"],
12
12
  }.freeze
@@ -17,7 +17,7 @@ module Plurimath
17
17
  end
18
18
 
19
19
  def to_asciimath
20
- "backslash"
20
+ "\\"
21
21
  end
22
22
 
23
23
  def to_unicodemath
@@ -25,7 +25,7 @@ module Plurimath
25
25
  end
26
26
 
27
27
  def to_mathml_without_math_tag
28
- ox_element("mi") << "&#x5c;"
28
+ ox_element("mo") << "\\"
29
29
  end
30
30
 
31
31
  def to_omml_without_math_tag(_)
@@ -26,7 +26,7 @@ module Plurimath
26
26
  end
27
27
 
28
28
  def to_mathml_without_math_tag
29
- ox_element("mi") << encoded
29
+ ox_element("mo") << encoded
30
30
  end
31
31
 
32
32
  def to_omml_without_math_tag(_)
@@ -26,7 +26,7 @@ module Plurimath
26
26
  end
27
27
 
28
28
  def to_mathml_without_math_tag
29
- ox_element("mi") << encoded
29
+ ox_element("mo") << encoded
30
30
  end
31
31
 
32
32
  def to_omml_without_math_tag(_)
@@ -26,7 +26,7 @@ module Plurimath
26
26
  end
27
27
 
28
28
  def to_mathml_without_math_tag
29
- ox_element("mi") << encoded
29
+ ox_element("mo") << encoded
30
30
  end
31
31
 
32
32
  def to_omml_without_math_tag(_)
@@ -3,10 +3,10 @@ module Plurimath
3
3
  module Symbols
4
4
  class Prime < Symbol
5
5
  INPUT = {
6
- unicodemath: ["&#x2032;", "prime"],
7
- asciimath: ["&#x2032;", "prime"],
6
+ unicodemath: ["&#x2032;", "prime", "'"],
7
+ asciimath: ["&#x2032;", "prime", "'"],
8
8
  mathml: ["&#x2032;"],
9
- latex: ["&#x2032;", "prime"],
9
+ latex: ["&#x2032;", "prime", "'"],
10
10
  omml: ["&#x2032;"],
11
11
  html: ["&#x2032;"],
12
12
  }.freeze
@@ -3,10 +3,10 @@ module Plurimath
3
3
  module Symbols
4
4
  class Sprime < Symbol
5
5
  INPUT = {
6
- unicodemath: ["&#x27;", "'"],
7
- asciimath: ["&#x27;", "'"],
6
+ unicodemath: ["&#x27;"],
7
+ asciimath: ["&#x27;"],
8
8
  mathml: ["&#x27;"],
9
- latex: ["&#x27;", "'"],
9
+ latex: ["&#x27;"],
10
10
  omml: ["&#x27;"],
11
11
  html: ["&#x27;"],
12
12
  }.freeze
@@ -270,7 +270,7 @@ module Plurimath
270
270
  def symbols_hash(lang)
271
271
  @@symbols ||= {}
272
272
  lang_symbols = @@symbols[lang]
273
- return lang_symbols if lang_symbols && lang_symbols.empty?
273
+ return lang_symbols if lang_symbols && !lang_symbols.empty?
274
274
 
275
275
  lang_symbols = {}
276
276
  symbols_files.map do |file_name|
@@ -290,7 +290,7 @@ module Plurimath
290
290
  def parens_hash(lang, skipables: nil)
291
291
  @@parens ||= {}
292
292
  lang_parens = @@parens[lang]
293
- return lang_parens if lang_parens && lang_parens.empty?
293
+ return lang_parens if lang_parens && !lang_parens.empty?
294
294
 
295
295
  lang_parens = {}
296
296
  paren_files.map do |file_name|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plurimath
4
- VERSION = "0.8.4"
4
+ VERSION = "0.8.6"
5
5
  end
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
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-02 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twitter_cldr