Skip to content

Commit

Permalink
drop dependency on mathml2asciimath: metanorma/metanorma-standoc#947
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Dec 24, 2024
1 parent 26aa16f commit fa94403
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 30 deletions.
3 changes: 2 additions & 1 deletion iev.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Gem::Specification.new do |spec|

spec.add_dependency "creek", "~> 2.5"
spec.add_dependency "glossarist", "~> 2.0.6"
spec.add_dependency "mathml2asciimath", "< 1"
spec.add_dependency "unitsml"
spec.add_dependency "plurimath"
spec.add_dependency "nokogiri", ">= 1.16.5"
spec.add_dependency "relaton", "~> 1.18"
spec.add_dependency "ruby-prof"
Expand Down
3 changes: 2 additions & 1 deletion lib/iev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

require "benchmark"
require "creek"
require "mathml2asciimath"
require "unitsml"
require "plurimath"
require "glossarist"
require "relaton"
require "relaton_bib"
Expand Down
6 changes: 3 additions & 3 deletions lib/iev/converter/mathml_to_asciimath.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def mathml_to_asciimath(input)
# to_asciimath.remove_namespaces!

to_asciimath.css("math").each do |math_element|
asciimath = MathML2AsciiMath.m2a(
text_to_asciimath(math_element.to_xml),
).strip
asciimath = Plurimath::Math.parse(
text_to_asciimath(math_element.to_xml), :mathml
).to_asciimath.strip
# puts"ASCIIMATH!! #{asciimath}"

if asciimath.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/iev/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module IEV
VERSION = "0.3.1".freeze
VERSION = "0.3.2".freeze
end
13 changes: 1 addition & 12 deletions spec/acceptance/db2yaml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,7 @@

let(:expected_concept2) do
{
"data" => {
"identifier" => "103-01-02",
"localized_concepts" =>
{
"ara" => "ab3f3785-fbed-5173-b6af-ca6eb0dcb3e1",
"deu" => "d9c63649-bec9-554f-b012-06e174acecdb",
"eng" => "ce70adb6-2252-5016-a843-2a42ce3327c7",
"fra" => "0ad9df6f-77a1-576f-9b46-2d0322bab4c7",
"jpn" => "c3d3dc36-68cf-5ba3-8483-3d94ebb7d26a",
"kor" => "88c5626d-0cd9-5616-8d04-e1a379eddda6",
},
},
"data" => {"identifier" => "103-01-02", "localized_concepts" => {"ara" => "ab3f3785-fbed-5173-b6af-ca6eb0dcb3e1", "deu" => "d9c63649-bec9-554f-b012-06e174acecdb", "eng" => "4843a9ad-4204-54db-804d-278538631d97", "fra" => "36ae6c8f-6b5a-57d3-9f9b-712b1a37359b", "jpn" => "c3d3dc36-68cf-5ba3-8483-3d94ebb7d26a", "kor" => "88c5626d-0cd9-5616-8d04-e1a379eddda6"}}
}
end

Expand Down
13 changes: 1 addition & 12 deletions spec/acceptance/xlsx2yaml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,7 @@

let(:expected_concept2) do
{
"data" => {
"identifier" => "103-01-02",
"localized_concepts" =>
{
"ara" => "ab3f3785-fbed-5173-b6af-ca6eb0dcb3e1",
"deu" => "d9c63649-bec9-554f-b012-06e174acecdb",
"eng" => "ce70adb6-2252-5016-a843-2a42ce3327c7",
"fra" => "0ad9df6f-77a1-576f-9b46-2d0322bab4c7",
"jpn" => "c3d3dc36-68cf-5ba3-8483-3d94ebb7d26a",
"kor" => "88c5626d-0cd9-5616-8d04-e1a379eddda6",
},
},
"data" =>{"identifier" => "103-01-02", "localized_concepts" => {"ara" => "ab3f3785-fbed-5173-b6af-ca6eb0dcb3e1", "deu" => "d9c63649-bec9-554f-b012-06e174acecdb", "eng" => "4843a9ad-4204-54db-804d-278538631d97", "fra" => "36ae6c8f-6b5a-57d3-9f9b-712b1a37359b", "jpn" => "c3d3dc36-68cf-5ba3-8483-3d94ebb7d26a", "kor" => "88c5626d-0cd9-5616-8d04-e1a379eddda6"}}
}
end

Expand Down

0 comments on commit fa94403

Please sign in to comment.