isodoc 3.7.30 → 3.7.32
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/isodoc.gemspec +1 -1
- data/lib/isodoc/presentation_function/designations.rb +12 -1
- data/lib/isodoc/presentation_function/index.rb +4 -4
- data/lib/isodoc/presentation_function/math.rb +11 -14
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_counter.rb +2 -2
- 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: 925b4ce91120fb5e574f411e4ce69c4553e8be148101b85937fccc52c87382ad
|
|
4
|
+
data.tar.gz: c879fb9893827e7ae2500294d0e95cd4bbbcf8a76d97d32e42525c41306958b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0a33fc975ae6f1c23e176db103bf1fdd7235a9c5bd25cb7910d6ea6ce571e2ea6f03928d81ed9fc8fe5b92465aaf3ff10759f316b13e7b149a4548630b0563e
|
|
7
|
+
data.tar.gz: 4875fa9498a05621a7f947b96d6e7053560ebdd5e683423376d8265af50b1c57b884cd7226e70a144e508980ad3a1ac2f346a42de421c874e60f75a9914b135d
|
data/isodoc.gemspec
CHANGED
|
@@ -48,7 +48,7 @@ Gem::Specification.new do |spec|
|
|
|
48
48
|
spec.add_dependency "mn-requirements", "~> 0.5.0"
|
|
49
49
|
# rhoella-cldr is the sealed CLDR data package rhoella reads; both are
|
|
50
50
|
# declared because the spellout paths address the package directly
|
|
51
|
-
# (
|
|
51
|
+
# (CLDR library retirement, metanorma/isodoc#949)
|
|
52
52
|
spec.add_dependency "rhoella", "~> 0.1"
|
|
53
53
|
spec.add_dependency "rhoella-cldr", "~> 0.1"
|
|
54
54
|
spec.add_dependency "roman-numerals"
|
|
@@ -95,7 +95,18 @@ module IsoDoc
|
|
|
95
95
|
firstex["language"] == secondex["language"] &&
|
|
96
96
|
!orig_first.at(ns("./pronunciation | ./grammar | ./graphical-symbol")) &&
|
|
97
97
|
!orig_second.at(ns("./pronunciation | ./grammar | ./graphical-symbol")) &&
|
|
98
|
-
orig_first.name == "preferred" && orig_second.name == "preferred"
|
|
98
|
+
orig_first.name == "preferred" && orig_second.name == "preferred" &&
|
|
99
|
+
!abbreviated?(firstex) && !abbreviated?(secondex)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# An abbreviated designation (expression carrying abbreviation-type,
|
|
103
|
+
# ISO 10241-1's abbreviation sense - e.g. "IT" for "standard
|
|
104
|
+
# tolerance") renders on its own line under the term per the ISO/IEC
|
|
105
|
+
# Directives, Part 2 term-entry layout; it never merges into the
|
|
106
|
+
# term's line with the synonym separator.
|
|
107
|
+
def abbreviated?(expression)
|
|
108
|
+
expression.is_a?(Nokogiri::XML::Element) &&
|
|
109
|
+
!expression.at(ns("./abbreviation-type")).nil?
|
|
99
110
|
end
|
|
100
111
|
|
|
101
112
|
def merge_preferred_eligible_prep(first, second)
|
|
@@ -31,7 +31,7 @@ module IsoDoc
|
|
|
31
31
|
index1_cleanup(docxml)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
# Ordering semantics changed with the
|
|
34
|
+
# Ordering semantics changed with the CLDR library retirement (owner
|
|
35
35
|
# directive 2026-11-30, documented in rhoella/rhoella#24 §5 and
|
|
36
36
|
# metanorma/isodoc#949): entries sort by their NFD-normalized form,
|
|
37
37
|
# tie-broken by the raw string. Deterministic, normalization-stable,
|
|
@@ -133,9 +133,9 @@ module IsoDoc
|
|
|
133
133
|
index.keys.sort.each_with_object({}) do |k, v|
|
|
134
134
|
# Index-term bucket key: the first letter, upcased and
|
|
135
135
|
# NFD-decomposed so accented letters fold onto their base letter
|
|
136
|
-
# ("É" and "E" share a bucket). Replaces the
|
|
137
|
-
#
|
|
138
|
-
#
|
|
136
|
+
# ("É" and "E" share a bucket). Replaces the CLDR transliterate
|
|
137
|
+
# monkey patch retired with the CLDR library retirement
|
|
138
|
+
# (rhoella/rhoella#24 §5, metanorma/isodoc#949);
|
|
139
139
|
# letters that do not decompose to ASCII keep their own bucket.
|
|
140
140
|
letter = sortable(k)[0].upcase.unicode_normalize(:nfd)[0]
|
|
141
141
|
v[letter] ||= {}
|
|
@@ -10,15 +10,14 @@ module IsoDoc
|
|
|
10
10
|
locale = @lang.to_sym
|
|
11
11
|
@numfmt = Plurimath::NumberFormatter
|
|
12
12
|
.new(locale, localize_number: @localizenumber,
|
|
13
|
-
localizer_symbols:
|
|
13
|
+
localizer_symbols: number_formatter_symbols)
|
|
14
14
|
docxml.xpath("//m:math", MATHML).each do |f| # rubocop:disable Style/CombinableLoops
|
|
15
15
|
f.parent&.parent&.name == "fmt-stem" or next
|
|
16
16
|
mathml1(f, locale)
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
# symbols is merged into
|
|
21
|
-
# TwitterCldr::DataReaders::NumberDataReader.new(locale).symbols
|
|
20
|
+
# symbols is merged into the Plurimath formatter's locale symbols
|
|
22
21
|
def localize_maths(node, locale)
|
|
23
22
|
node.xpath(".//m:mn", MATHML).each do |x|
|
|
24
23
|
fmt = x["data-metanorma-numberformat"]
|
|
@@ -101,7 +100,7 @@ module IsoDoc
|
|
|
101
100
|
end
|
|
102
101
|
|
|
103
102
|
def explicit_number_formatter_cfg(num, fmt)
|
|
104
|
-
symbols =
|
|
103
|
+
symbols = number_formatter_symbols.dup.transform_values do |v|
|
|
105
104
|
v.is_a?(String) ? HTMLEntities.new.decode(v) : v
|
|
106
105
|
end.merge(fmt)
|
|
107
106
|
symbols = large_notation_fmt(symbols, num.text)
|
|
@@ -142,7 +141,7 @@ module IsoDoc
|
|
|
142
141
|
def num_precision(num)
|
|
143
142
|
precision = nil
|
|
144
143
|
/\.(?!\d+e)/.match?(num) and
|
|
145
|
-
precision =
|
|
144
|
+
precision = number_formatter_symbols[:precision] ||
|
|
146
145
|
# [^.]* excludes the delimiter itself, preventing polynomial
|
|
147
146
|
# backtracking on strings with multiple dots.
|
|
148
147
|
num.sub(/\A[^.]*\./, "").size
|
|
@@ -152,7 +151,7 @@ module IsoDoc
|
|
|
152
151
|
def num_totaldigits(num, base = 10)
|
|
153
152
|
totaldigits = nil
|
|
154
153
|
/\.(?=\d+e)/.match?(num) and
|
|
155
|
-
totaldigits =
|
|
154
|
+
totaldigits = number_formatter_symbols[:significant] ||
|
|
156
155
|
num_totaldigits_compute(num, base)
|
|
157
156
|
totaldigits
|
|
158
157
|
end
|
|
@@ -200,14 +199,12 @@ module IsoDoc
|
|
|
200
199
|
end
|
|
201
200
|
|
|
202
201
|
# Number-symbol injection hook, consulted by the Plurimath formatter
|
|
203
|
-
# wiring above
|
|
204
|
-
#
|
|
205
|
-
#
|
|
206
|
-
#
|
|
207
|
-
#
|
|
208
|
-
|
|
209
|
-
# metanorma-iso override silently.
|
|
210
|
-
def twitter_cldr_localiser_symbols
|
|
202
|
+
# wiring above: a plain-hash override point passed to Plurimath
|
|
203
|
+
# as `localizer_symbols:`. metanorma-iso (presentation_xml_convert.rb)
|
|
204
|
+
# overrides it with ISO's NBSP group separator and comma decimal
|
|
205
|
+
# mark, and the numberformat specs stub it. Renaming it again would
|
|
206
|
+
# break the metanorma-iso override silently.
|
|
207
|
+
def number_formatter_symbols
|
|
211
208
|
{}
|
|
212
209
|
end
|
|
213
210
|
|
data/lib/isodoc/version.rb
CHANGED
|
@@ -172,8 +172,8 @@ module IsoDoc
|
|
|
172
172
|
num.nil? and return num
|
|
173
173
|
case @style
|
|
174
174
|
when :roman then RomanNumerals.to_roman(num)
|
|
175
|
-
# ja spellout-cardinal is byte-identical between
|
|
176
|
-
# rhoella (the
|
|
175
|
+
# ja spellout-cardinal is byte-identical between the previous
|
|
176
|
+
# CLDR engine and rhoella (the retirement equivalence gate)
|
|
177
177
|
when :japanese then Rhoella.spellout(num, locale: "ja")
|
|
178
178
|
else num
|
|
179
179
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: isodoc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.7.
|
|
4
|
+
version: 3.7.32
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-12-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|