metanorma-iso 2.6.0 → 2.6.1

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: fb4c2d0b884e8601efbd7d6d0bfa000846b52709fadbd38317e9398493ad8cd0
4
- data.tar.gz: 8d7846f9bf8bfc5e684f66542f9ea6a166f99043edc9d982a4e61ad69b0a63a5
3
+ metadata.gz: 7c067cd90bfc946d6c179fba63a5f83cc0f803aabf6b1ab44c3ae81bd3a948ed
4
+ data.tar.gz: 40effc5bdc15f1e0a869b39e211bb2a2355938f58a39e5e46b04358c35c44d38
5
5
  SHA512:
6
- metadata.gz: 40264b7b5e2b23244b502f8b0e63a9041ed06dfc6401c86ef3b418de8c38aae94187319f3e28852122b871d06e3fb122286cb575b2e0a6c3e60caaa571ccbc38
7
- data.tar.gz: 5f0c03ecba1d00e25764620a02c345486d84b29b419d3749677810cc51672c695f4bab205cfa00d61bc01c59a4dff931209b3855912c90aeded9408c04214939
6
+ metadata.gz: 714502eb99f9d9ad48d2b9c4c43c77b00ebcde0d632496a1cbcc8d3ee37345f60322203f8ed76c806b3b6d7a55da86ea44be693379c82e8f8687f3336ecc8bd1
7
+ data.tar.gz: f0e71370ae6cfa856e8c533fdb1f87ee61cd62deb20c083e6d9ce15a5b69b4300e10228b67d8cfdc6152119d334354fc8088b92133ecc7359e6082f8a54cbddd
@@ -0,0 +1,94 @@
1
+ term_def_boilerplate: |
2
+ <p>ISO und IEC unterhalten Terminologiedatenbanken zur Verwendung in
3
+ Standardisierung unter folgenden Adressen:</p>
4
+
5
+ <ul>
6
+ <li><p>Online-Browsing-Plattform: verfügbar unter
7
+ <link target="https://www.iso.org/obp"/></p></li>
8
+ <li><p>IEC Electropedia: verfügbar unter
9
+ <link target="https://www.electropedia.org"/></p></li>
10
+ </ul>
11
+ all_rights_reserved: Alle Rechte vorbehalten
12
+ reference_number: Referenznummer
13
+ price_based_on: Preis basierend auf % Seiten
14
+ descriptor: Deskriptor
15
+ under_preparation: In Vorbereitung. (Stadium zum Zeitpunkt der Veröffentlichung %).
16
+ withdrawn: Zurückgezogen.
17
+ cancelled_and_replaced: Abgebrochen und ersetzt durch %.
18
+ table_of_contents: Inhalt
19
+ date: datum
20
+ index: Index
21
+ see: Schau
22
+ see_also: siehe auch
23
+ secretariat: Sekretariat
24
+ edition: Ausgabe
25
+ termsrelated: Begriffe im Zusammenhang mit
26
+ availablefrom: Verfügbar ab
27
+ voting_begins_on: Die Abstimmung beginnt am
28
+ voting_terminates_on: Die Abstimmung endet am
29
+ corrected_version: Korrigierte Version
30
+ multiple_and: "%1 und %2"
31
+ multiple_or: "%1 oder %2"
32
+ doctype_dict:
33
+ international-standard: Internationaler Standard
34
+ technical-specification: Technische Spezifikation
35
+ technical-report: Technischer Bericht
36
+ publicly-available-specification: Öffentlich verfügbare Spezifikation
37
+ international-workshop-agreement: Internationales Workshop-Vereinbarung
38
+ guide: Leitfaden
39
+ amendment: Änderung
40
+ technical-corrigendum: Technische Berichtigung
41
+ directive: Richtlinie
42
+ stage_dict:
43
+ "00": Vorläufiges Arbeitselement
44
+ "10": Neuer Arbeitselementvorschlag
45
+ "20": Arbeitsentwurf
46
+ "30": Ausschussentwurf
47
+ "40":
48
+ international-standard: Entwurf des internationalen Standards
49
+ technical-specification: Entwurf der technischen Spezifikation
50
+ technical-report: Entwurf des technischen Berichts
51
+ publicly-available-specification: Entwurf der öffentlich verfügbaren Spezifikation
52
+ international-workshop-agreement: Entwurf der internationalen Workshop-Vereinbarung
53
+ guide: Leitfadenentwurf
54
+ amendment: Änderungsentwurf
55
+ technical-corrigendum: Entwurf der technischen Berichtigung
56
+ directive: Richtlinienentwurf
57
+ "50":
58
+ international-standard: Endgültiger Entwurf des internationalen Standards
59
+ technical-specification: Endgültiger Entwurf der technischen Spezifikation
60
+ technical-report: Endgültiger Entwurf des technischen Berichts
61
+ publicly-available-specification: Endgültiger Entwurf der öffentlich verfügbaren Spezifikation
62
+ international-workshop-agreement: Endgültiger Entwurf der internationalen Workshop-Vereinbarung
63
+ guide: Endgültiger Leitfadenentwurf
64
+ amendment: Endgültiger Änderungsentwurf
65
+ technical-corrigendum: Endgültiger Entwurf der technischen Berichtigung
66
+ directive: Endgültiger Richtlinienentwurf
67
+ "60":
68
+ international-standard: Internationaler Standard
69
+ technical-specification: Technische Spezifikation
70
+ technical-report: Technischer Bericht
71
+ publicly-available-specification: Öffentlich verfügbare Spezifikation
72
+ international-workshop-agreement: Internationales Workshop-Vereinbarung
73
+ guide: Leitfaden
74
+ amendment: Änderung
75
+ technical-corrigendum: Technische Berichtigung
76
+ directive: Richtlinie
77
+ "90": Rezension
78
+ "95": Rückzug
79
+ locality:
80
+ appendix: Anhang
81
+ requirements:
82
+ modspec:
83
+ provision: Bereitstellung
84
+ conformancetest: Konformitätstest
85
+ inflection:
86
+ Bereitstellung:
87
+ sg: Bereitstellung
88
+ pl: Bereitstellungen
89
+ Aussage:
90
+ sg: Aussage
91
+ pl: Aussagen
92
+ Deskriptor:
93
+ sg: Deskriptor
94
+ pl: Deskriptoren
@@ -1,23 +1,16 @@
1
1
  module IsoDoc
2
2
  module Iso
3
3
  class I18n < IsoDoc::I18n
4
- def load_file(fname)
5
- YAML.load_file(File.join(File.dirname(__FILE__), fname)) ||
6
- {}
4
+ # name iso_load_file instead of load_file
5
+ # so that child flavours cannot inherit it and override it
6
+ def iso_load_file(fname)
7
+ f = File.join(File.dirname(__FILE__), fname)
8
+ File.exist?(f) ? YAML.load_file(f) : {}
7
9
  end
8
10
 
9
- # all gems inheriting from ISO need to be represented here,
10
- # even if the file is empty
11
- # e.g. JA for metanorma-jis
12
11
  def load_yaml1(lang, script)
13
- y = if lang == "en" then load_file("i18n-en.yaml")
14
- elsif lang == "fr" then load_file("i18n-fr.yaml")
15
- elsif lang == "ru" then load_file("i18n-ru.yaml")
16
- elsif lang == "ja" then load_file("i18n-ja.yaml")
17
- elsif lang == "zh" && script == "Hans"
18
- load_file("i18n-zh-Hans.yaml")
19
- else load_file("i18n-en.yaml")
20
- end
12
+ y = iso_load_file("i18n-#{yaml_lang(lang, script)}.yaml")
13
+ y.empty? and return iso_load_file("i18n-en.yaml").deep_merge(super)
21
14
  super.deep_merge(y)
22
15
  end
23
16
  end
@@ -8,11 +8,9 @@ module IsoDoc
8
8
  end
9
9
 
10
10
  def warning_for_missing_metadata(docxml)
11
- return unless @meta.get[:unpublished]
12
-
11
+ @meta.get[:unpublished] or return
13
12
  ret = warning_for_missing_metadata_create(docxml)
14
- return if ret.empty?
15
-
13
+ ret.empty? and return
16
14
  warning_for_missing_metadata_post(docxml, ret)
17
15
  end
18
16
 
@@ -73,10 +71,10 @@ module IsoDoc
73
71
  def bibdata_i18n_stage(bib, stage, type, lang: @lang, i18n: @i18n)
74
72
  return unless stage
75
73
 
76
- i18n.get["stage_dict"][stage.text].is_a?(Hash) or
74
+ i18n.get.dig("stage_dict", stage.text).is_a?(Hash) or
77
75
  return hash_translate(bib, i18n.get["stage_dict"],
78
76
  "./status/stage", lang)
79
- stagetype = i18n.get["stage_dict"][stage.text][type&.text] and
77
+ stagetype = i18n.get.dig("stage_dict", stage.text, type&.text) and
80
78
  tag_translate(stage, lang, stagetype)
81
79
  end
82
80
  end
@@ -105,6 +105,7 @@ module IsoDoc
105
105
  locality_span_wrap(ret, opt[:type])
106
106
  end
107
107
 
108
+ =begin
108
109
  def prefix_container(container, linkend, node, target)
109
110
  delim = ", "
110
111
  ref = if @xrefs.anchor(target, :type) == "listitem" &&
@@ -118,6 +119,29 @@ module IsoDoc
118
119
  ref and linkend = ref + delim + linkend
119
120
  l10n(linkend)
120
121
  end
122
+ =end
123
+
124
+ # 7 a) : Clause 7 a), but Clause 7 List 1 a)
125
+ def prefix_container(container, linkend, node, target)
126
+ prefix_container?(container, node) or return linkend
127
+ container_container = @xrefs.anchor(container, :container, false)
128
+ nested_xref, container_label =
129
+ prefix_container_template(container, node, target)
130
+ container_label = prefix_container(container_container,
131
+ container_label, node, target)
132
+ l10n(nested_xref.sub("%1", container_label).sub("%2", linkend))
133
+ end
134
+
135
+ def prefix_container_template(container, node, target)
136
+ nested_xref = @i18n.nested_xref
137
+ container_label = anchor_xref(node, container)
138
+ if @xrefs.anchor(target, :type) == "listitem" &&
139
+ !@xrefs.anchor(target, :refer_list)
140
+ nested_xref = "%1 %2"
141
+ container_label = @xrefs.anchor(container, :label)
142
+ end
143
+ [nested_xref, container_label]
144
+ end
121
145
 
122
146
  def expand_citeas(text)
123
147
  std_docid_semantic(super)
@@ -125,7 +149,7 @@ module IsoDoc
125
149
 
126
150
  def anchor_value(id)
127
151
  locality_span_wrap(super, @xrefs.anchor(id, :subtype) ||
128
- @xrefs.anchor(id, :type))
152
+ @xrefs.anchor(id, :type))
129
153
  end
130
154
 
131
155
  def anchor_linkend1(node)
@@ -57,10 +57,10 @@ module IsoDoc
57
57
  end
58
58
  end
59
59
 
60
- def figure_anchor(elem, sublabel, label, klass)
60
+ def figure_anchor(elem, sublabel, label, klass, container: false)
61
61
  @anchors[elem["id"]] = anchor_struct(
62
- "#{label}#{sublabel}",
63
- nil, @labels[klass] || klass.capitalize, klass, elem["unnumbered"]
62
+ "#{label}#{sublabel}", container ? elem : nil,
63
+ @labels[klass] || klass.capitalize, klass, elem["unnumbered"]
64
64
  )
65
65
  !sublabel.empty? && elem["unnumbered"] != "true" and
66
66
  @anchors[elem["id"]][:label] = sublabel
@@ -71,18 +71,18 @@ module IsoDoc
71
71
  " #{(subfignum + 96).chr})"
72
72
  end
73
73
 
74
- def sequential_figure_names(clause)
74
+ def sequential_figure_names(clause, container: false)
75
75
  j = 0
76
76
  clause.xpath(ns(FIGURE_NO_CLASS)).noblank
77
77
  .each_with_object(IsoDoc::XrefGen::Counter.new) do |t, c|
78
78
  j = subfigure_increment(j, c, t)
79
79
  sublabel = subfigure_label(j)
80
- figure_anchor(t, sublabel, c.print, "figure")
80
+ figure_anchor(t, sublabel, c.print, "figure", container: container)
81
81
  end
82
- sequential_figure_class_names(clause)
82
+ sequential_figure_class_names(clause, container: container)
83
83
  end
84
84
 
85
- def sequential_figure_class_names(clause)
85
+ def sequential_figure_class_names(clause, container: false)
86
86
  c = {}
87
87
  j = 0
88
88
  clause.xpath(ns(".//figure[@class][not(@class = 'pseudocode')]"))
@@ -90,7 +90,7 @@ module IsoDoc
90
90
  c[t["class"]] ||= IsoDoc::XrefGen::Counter.new
91
91
  j = subfigure_increment(j, c[t["class"]], t)
92
92
  sublabel = j.zero? ? nil : "#{(j + 96).chr})"
93
- figure_anchor(t, sublabel, c.print, t["class"])
93
+ figure_anchor(t, sublabel, c.print, t["class"], container: container)
94
94
  end
95
95
  end
96
96
 
@@ -154,23 +154,23 @@ module IsoDoc
154
154
  true
155
155
  end
156
156
 
157
- def sequential_table_names(clause)
157
+ def sequential_table_names(clause, container: false)
158
158
  super
159
- modspec_table_xrefs(clause) if @anchors_previous
159
+ modspec_table_xrefs(clause, container: container) if @anchors_previous
160
160
  end
161
161
 
162
- def modspec_table_xrefs(clause)
162
+ def modspec_table_xrefs(clause, container: false)
163
163
  clause.xpath(ns(".//table[@class = 'modspec']")).noblank.each do |t|
164
164
  n = @anchors[t["id"]][:xref]
165
165
  xref_to_modspec(t["id"], n) or next
166
- modspec_table_components_xrefs(t, n)
166
+ modspec_table_components_xrefs(t, n, container: container)
167
167
  end
168
168
  end
169
169
 
170
- def modspec_table_components_xrefs(table, table_label)
170
+ def modspec_table_components_xrefs(table, table_label, container: false)
171
171
  table.xpath(ns(".//tr[@id]")).each do |tr|
172
172
  xref_to_modspec(tr["id"], table_label) or next
173
- @anchors[tr["id"]].delete(:container)
173
+ container or @anchors[tr["id"]].delete(:container)
174
174
  end
175
175
  end
176
176
 
@@ -374,6 +374,16 @@
374
374
  <ref name="image"/>
375
375
  </element>
376
376
  </define>
377
+ <define name="depiction">
378
+ <element name="depiction">
379
+ <optional>
380
+ <attribute name="scope"/>
381
+ </optional>
382
+ <zeroOrMore>
383
+ <ref name="image"/>
384
+ </zeroOrMore>
385
+ </element>
386
+ </define>
377
387
  <define name="NameWithVariants">
378
388
  <element name="primary">
379
389
  <ref name="LocalizedString"/>
@@ -760,6 +770,9 @@
760
770
  <optional>
761
771
  <ref name="validity"/>
762
772
  </optional>
773
+ <optional>
774
+ <ref name="depiction"/>
775
+ </optional>
763
776
  </define>
764
777
  <define name="ReducedBibliographicItem">
765
778
  <optional>
@@ -2,7 +2,7 @@
2
2
  === {% if stage_int >= 40 %}DOCUMENT PROTÉGÉ PAR COPYRIGHT{%else%}{blank}{%endif%}
3
3
 
4
4
  [[boilerplate-year]]
5
- &#xa9; span:std_publisher:[{{ agency }}]&#xa0;span:std_docNumber[{{ docyear }}]
5
+ &#xa9; span:std_publisher:[{{ agency }}&#xa0;]span:std_docNumber[{{ docyear }}]
6
6
 
7
7
  [[boilerplate-message]]
8
8
  Droits de reproduction réservés. Sauf indication contraire, ou requise dans le cadre de sa mise en œuvre,
@@ -3,7 +3,7 @@
3
3
  === {% if stage_int >= 40 %}ДОКУМЕНТ, ОХРАНЯЕМЫЙ АВТОРСКИМ ПРАВОМ{% else %}{blank}{% endif %}
4
4
 
5
5
  [[boilerplate-year]]
6
- &#xa9; span:std_publisher[{{ agency }}]&#xa0;span:std_docNumber[{{ docyear }}]
6
+ &#xa9; span:std_publisher[{{ agency }}&#xa0;]span:std_docNumber[{{ docyear }}]
7
7
 
8
8
  [[boilerplate-message]]
9
9
  Все права защищены. Если иначе не определено или не требуется в контексте его реализации, никакая часть этой публикации не может быть воспроизведена или использована иначе в любой форме или каким-либо образом, электронным или механическим, включая фотокопирование, или публикацию в Интернете или интранете, без предварительного письменного разрешения. Разрешение может быть запрошено ISO по адресу, указанному ниже, или у органа — члена ISO страны запрашивающего.
@@ -3,7 +3,7 @@
3
3
  === {% if stage_int >= 40 %}COPYRIGHT PROTECTED DOCUMENT{% else %}{blank}{% endif %}
4
4
 
5
5
  [[boilerplate-year]]
6
- &#xa9; span:std_publisher[{{ agency }}]&#xa0;span:std_docNumber[{{ docyear }}]
6
+ &#xa9; span:std_publisher[{{ agency }}&#xa0;]span:std_docNumber[{{ docyear }}]
7
7
 
8
8
  [[boilerplate-message]]
9
9
  All rights reserved. Unless otherwise specified, or required in the context of its implementation,
@@ -137,9 +137,10 @@ module Metanorma
137
137
  xmldoc.xpath("//bibitem[not(./ancestor::bibitem)]" \
138
138
  "[not(note[@type = 'Unpublished-Status'])]").each do |b|
139
139
  pub_class(b) > 2 and next
140
- ((s = b.at("./status/stage")) && (s.text.to_i < 60)) or next
141
- id = b.at("docidentifier").text
142
- insert_unpub_note(b, @i18n.under_preparation.sub("%", id))
140
+ ((s = b.at("./status/stage")) && s.text.match?(/\d/) &&
141
+ (s.text.to_i < 60)) or next
142
+ insert_unpub_note(b, @i18n.under_preparation
143
+ .sub("%", b.at("docidentifier").text))
143
144
  end
144
145
  end
145
146
 
@@ -64,7 +64,6 @@ module Metanorma
64
64
  def report_illegal_stage(stage, substage)
65
65
  err = "Illegal document stage: #{stage}.#{substage}"
66
66
  @log.add("Document Attributes", nil, err)
67
- warn err
68
67
  end
69
68
 
70
69
  def title_intro(node, xml, lang, at)
@@ -6,6 +6,8 @@ require "pathname"
6
6
  require "open-uri"
7
7
  require "twitter_cldr"
8
8
  require "pubid-iso"
9
+ require "pubid-cen"
10
+ require "pubid-iec"
9
11
 
10
12
  module Metanorma
11
13
  module ISO
@@ -36,8 +38,8 @@ module Metanorma
36
38
  end
37
39
 
38
40
  def iso_id(node, xml)
39
- (!@amd && node.attr("docnumber")) || (@amd && node.attr("updates")) or
40
- return
41
+ (!@amd && node.attr("docnumber") || node.attr("adopted-from")) ||
42
+ (@amd && node.attr("updates")) or return
41
43
  params = iso_id_params(node)
42
44
  iso_id_out(xml, params, true)
43
45
  end
@@ -45,13 +47,39 @@ module Metanorma
45
47
  def iso_id_params(node)
46
48
  params = iso_id_params_core(node)
47
49
  params2 = iso_id_params_add(node)
48
- if node.attr("updates")
49
- orig_id = Pubid::Iso::Identifier::Base.parse(node.attr("updates"))
50
- orig_id.edition ||= 1
51
- end
50
+ num = node.attr("docnumber")
51
+ orig = node.attr("updates") || node.attr("adopted-from")
52
+ /^\d+$/.match?(num) or orig ||= num
53
+ orig and orig_id = orig_id_parse(orig)
52
54
  iso_id_params_resolve(params, params2, node, orig_id)
53
55
  end
54
56
 
57
+ def cen?(str)
58
+ /^C?EN/.match?(str)
59
+ end
60
+
61
+ def orig_id_parse(orig)
62
+ cen?(orig) and return Pubid::Cen::Identifier::Base.parse(orig)
63
+ ret = case orig
64
+ when /^ISO/ then Pubid::Iso::Identifier::Base.parse(orig)
65
+ when /^IEC/ then Pubid::Iec::Identifier::Base.parse(orig)
66
+ else base_pubid::Base.parse(orig)
67
+ end
68
+ ret.edition ||= 1
69
+ ret
70
+ end
71
+
72
+ def base_pubid
73
+ Pubid::Iso::Identifier
74
+ end
75
+
76
+ def pubid_select(params)
77
+ if cen?(Array(params[:publisher])&.first || "")
78
+ Pubid::Cen::Identifier
79
+ else base_pubid
80
+ end
81
+ end
82
+
55
83
  # unpublished is for internal use
56
84
  def iso_id_params_core(node)
57
85
  pub = (node.attr("publisher") || "ISO").split(/[;,]/)
@@ -72,7 +100,7 @@ module Metanorma
72
100
  node.attr("corrigendum-number"),
73
101
  year: iso_id_year(node),
74
102
  iteration: node.attr("iteration") }.compact
75
- if stage
103
+ if stage && !cen?(node.attr("publisher"))
76
104
  ret[:stage] = stage
77
105
  ret[:stage] == "60.00" and ret[:stage] = :PRF
78
106
  end
@@ -92,30 +120,45 @@ module Metanorma
92
120
  def iso_id_params_resolve(params, params2, node, orig_id)
93
121
  if orig_id && (node.attr("amendment-number") ||
94
122
  node.attr("corrigendum-number"))
95
- params.delete(:unpublished)
96
- params.delete(:part)
123
+ %i(unpublished part).each { |x| params.delete(x) }
97
124
  params2[:base] = orig_id
125
+ elsif orig_id &&
126
+ ![Pubid::Iso::Identifier,
127
+ Pubid::Iec::Identifier].include?(pubid_select(params))
128
+ params2[:adopted] = orig_id
98
129
  end
99
130
  params.merge!(params2)
100
131
  params
101
132
  end
102
133
 
103
134
  def iso_id_out(xml, params, with_prf)
135
+ cen?(params[:publisher]) and return cen_id_out(xml, params)
136
+ iso_id_out_common(xml, params, with_prf)
137
+ @amd and return
138
+ iso_id_out_non_amd(xml, params, with_prf)
139
+ rescue StandardError => e
140
+ clean_abort("Document identifier: #{e}", xml)
141
+ end
142
+
143
+ def cen_id_out(xml, params)
144
+ xml.docidentifier iso_id_default(params).to_s, **attr_code(type: "CEN")
145
+ end
146
+
147
+ def iso_id_out_common(xml, params, with_prf)
104
148
  xml.docidentifier iso_id_default(params).to_s(with_prf: with_prf),
105
149
  **attr_code(type: "ISO")
106
150
  xml.docidentifier iso_id_reference(params)
107
151
  .to_s(format: :ref_num_short, with_prf: with_prf),
108
152
  **attr_code(type: "iso-reference")
109
153
  xml.docidentifier iso_id_reference(params).urn, **attr_code(type: "URN")
110
- return if @amd
154
+ end
111
155
 
156
+ def iso_id_out_non_amd(xml, params, with_prf)
112
157
  xml.docidentifier iso_id_undated(params).to_s(with_prf: with_prf),
113
158
  **attr_code(type: "iso-undated")
114
159
  xml.docidentifier iso_id_with_lang(params)
115
160
  .to_s(format: :ref_num_long, with_prf: with_prf),
116
161
  **attr_code(type: "iso-with-lang")
117
- rescue StandardError => e
118
- clean_abort("Document identifier: #{e}", xml)
119
162
  end
120
163
 
121
164
  def iso_id_default(params)
@@ -127,7 +170,7 @@ module Metanorma
127
170
  else params_nolang
128
171
  end
129
172
  params1.delete(:unpublished)
130
- Pubid::Iso::Identifier.create(**params1)
173
+ pubid_select(params1).create(**params1)
131
174
  end
132
175
 
133
176
  def iso_id_undated(params)
@@ -136,7 +179,7 @@ module Metanorma
136
179
  hs.delete(:year)
137
180
  hs.delete(:unpublished)
138
181
  end
139
- Pubid::Iso::Identifier.create(**params2)
182
+ pubid_select(params2).create(**params2)
140
183
  end
141
184
 
142
185
  def iso_id_with_lang(params)
@@ -146,17 +189,16 @@ module Metanorma
146
189
  end
147
190
  else params end
148
191
  params1.delete(:unpublished)
149
- Pubid::Iso::Identifier.create(**params1)
192
+ pubid_select(params1).create(**params1)
150
193
  end
151
194
 
152
195
  def iso_id_reference(params)
153
196
  params1 = params.dup.tap { |hs| hs.delete(:unpublished) }
154
- Pubid::Iso::Identifier.create(**params1)
197
+ pubid_select(params1).create(**params1)
155
198
  end
156
199
 
157
200
  def structured_id(node, xml)
158
- return unless node.attr("docnumber")
159
-
201
+ node.attr("docnumber") or return
160
202
  part, subpart = node&.attr("partnumber")&.split("-")
161
203
  xml.structuredidentifier do |i|
162
204
  i.project_number(node.attr("docnumber"), **attr_code(
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.8 -->
20
+ <!-- VERSION v1.2.9 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -1958,6 +1958,16 @@
1958
1958
  <data type="boolean"/>
1959
1959
  </attribute>
1960
1960
  </optional>
1961
+ <optional>
1962
+ <attribute name="type">
1963
+ <choice>
1964
+ <value>letter</value>
1965
+ <value>symbol</value>
1966
+ <value>formula</value>
1967
+ <value>equation</value>
1968
+ </choice>
1969
+ </attribute>
1970
+ </optional>
1961
1971
  <element name="name">
1962
1972
  <oneOrMore>
1963
1973
  <choice>
@@ -123,11 +123,11 @@ module Metanorma
123
123
  # https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-n-numbers
124
124
  def style_number(node, text)
125
125
  style_number_grouping(node, text)
126
- style_regex(/\b(?<num>[0-9]+\.[0-9]+)/i,
126
+ style_regex(/(?:^|\p{Zs})(?<num>[0-9]+\.[0-9]+)(?!\.[0-9])/i,
127
127
  "possible decimal point", node, text)
128
128
  @lang == "en" and style_regex(/\b(?<num>billions?)\b/i,
129
129
  "ambiguous number", node, text)
130
- style_regex(/(?:^|\P{Zs})(?<num>-[0-9][0-9,.]*)/i,
130
+ style_regex(/(?:^|\p{Zs})(?<num>-[0-9][0-9,.]*)/i,
131
131
  "hyphen instead of minus sign U+2212", node, text)
132
132
  end
133
133
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "2.6.0".freeze
3
+ VERSION = "2.6.1".freeze
4
4
  end
5
5
  end
@@ -35,6 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.add_dependency "metanorma-standoc", "~> 2.7.0"
36
36
  spec.add_dependency "mnconvert", "~> 1.14"
37
37
  spec.add_dependency "pubid-iso", "~> 0.6.0"
38
+ spec.add_dependency "pubid-cen"
39
+ spec.add_dependency "pubid-iec"
38
40
  spec.add_dependency "ruby-jing"
39
41
  spec.add_dependency "tokenizer", "~> 0.3.0"
40
42
  spec.add_dependency "twitter_cldr"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-27 00:00:00.000000000 Z
11
+ date: 2023-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.6.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: pubid-cen
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pubid-iec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: ruby-jing
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -338,6 +366,7 @@ files:
338
366
  - lib/isodoc/iso/html/wordstyle.css
339
367
  - lib/isodoc/iso/html/wordstyle.scss
340
368
  - lib/isodoc/iso/html_convert.rb
369
+ - lib/isodoc/iso/i18n-de.yaml
341
370
  - lib/isodoc/iso/i18n-en.yaml
342
371
  - lib/isodoc/iso/i18n-fr.yaml
343
372
  - lib/isodoc/iso/i18n-ja.yaml