metanorma-standoc 3.5.2 → 3.5.3
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8808acd759aa7b130b2afb79e10a7299f28ac19ee9049f4f85ccf564a6658f39
|
|
4
|
+
data.tar.gz: 916fee107a523cf51a52145ba024471d6556d8eb4e721165ce5965295414199f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55f619f67cd98e47a859a0b82a1215639a517288a25f89d09369ac8bef187b86ad13bebbe98443f9d79b646cad0fece4568a286ee35d4df5399c4a259ea6a264
|
|
7
|
+
data.tar.gz: 2dacb944bce0af6d09f0fdea02c23664e859e6ddf8afa49295fe88f2b3ca72babf53aedea99218e678191f79d8ef32c471ac685e1e3f4e7f9cf2746b55558356
|
|
@@ -8,7 +8,7 @@ module Metanorma
|
|
|
8
8
|
class StructuredIdentifierType < Lutaml::Model::Serializable
|
|
9
9
|
attribute :type, :string
|
|
10
10
|
attribute :agency, :string, collection: true
|
|
11
|
-
attribute :
|
|
11
|
+
attribute :identifier_class, :string
|
|
12
12
|
attribute :docnumber, :string
|
|
13
13
|
attribute :partnumber, :string
|
|
14
14
|
attribute :edition, :string
|
|
@@ -27,7 +27,7 @@ module Metanorma
|
|
|
27
27
|
element "structuredidentifier"
|
|
28
28
|
map_attribute "type", to: :type
|
|
29
29
|
map_element "agency", to: :agency
|
|
30
|
-
map_attribute "class", to: :
|
|
30
|
+
map_attribute "class", to: :identifier_class
|
|
31
31
|
map_attribute "docnumber", to: :docnumber
|
|
32
32
|
map_attribute "partnumber", to: :partnumber
|
|
33
33
|
map_attribute "edition", to: :edition
|
|
@@ -92,7 +92,7 @@ module Metanorma
|
|
|
92
92
|
ret = doc.xpath("//term").each_with_object({}) do |t, m|
|
|
93
93
|
prefix = t.at("./domain")&.text
|
|
94
94
|
t.xpath("./preferred//name").each do |n|
|
|
95
|
-
ret = n
|
|
95
|
+
ret = designation_text(n)
|
|
96
96
|
prefix and ret = "<#{prefix}> #{ret}"
|
|
97
97
|
m[ret] ||= []
|
|
98
98
|
m[ret] << t
|
|
@@ -101,6 +101,16 @@ module Metanorma
|
|
|
101
101
|
preferred_validate_report(ret)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
+
# The designation text excludes nested index entries: <name> carries
|
|
105
|
+
# an <index><primary> duplicate of its own text, and counting that
|
|
106
|
+
# text doubled every designation ("Term abstract test methodabstract
|
|
107
|
+
# test method occurs twice...", metanorma-iso#1681).
|
|
108
|
+
def designation_text(name)
|
|
109
|
+
name = name.dup
|
|
110
|
+
name.xpath("./index").each(&:remove)
|
|
111
|
+
name.text
|
|
112
|
+
end
|
|
113
|
+
|
|
104
114
|
def preferred_validate_report(terms)
|
|
105
115
|
terms.each do |k, v|
|
|
106
116
|
v.size > 1 or next
|