metanorma-iso 3.1.0 → 3.1.2
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/README.adoc +1 -1
- data/lib/isodoc/iso/i18n-de.yaml +64 -0
- data/lib/isodoc/iso/i18n-en.yaml +2 -0
- data/lib/isodoc/iso/i18n-fr.yaml +46 -11
- data/lib/isodoc/iso/i18n-ru.yaml +61 -0
- data/lib/isodoc/iso/iso.amendment.xsl +591 -364
- data/lib/isodoc/iso/iso.international-standard.xsl +591 -364
- data/lib/isodoc/iso/metadata.rb +28 -21
- data/lib/isodoc/iso/presentation_bibdata.rb +2 -0
- data/lib/isodoc/iso/xref.rb +8 -12
- data/lib/metanorma/iso/basicdoc.rng +6 -6
- data/lib/metanorma/iso/front_contributor.rb +145 -21
- data/lib/metanorma/iso/front_id.rb +1 -7
- data/lib/metanorma/iso/isodoc.rng +8 -60
- data/lib/metanorma/iso/validate_requirements.rb +34 -36
- data/lib/metanorma/iso/validate_style.rb +9 -4
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/relaton/render/config.yml +1 -1
- data/metanorma-iso.gemspec +1 -1
- metadata +3 -3
@@ -18,15 +18,15 @@ module Metanorma
|
|
18
18
|
\\b
|
19
19
|
REGEXP
|
20
20
|
|
21
|
-
def
|
22
|
-
Regexp.new(
|
23
|
-
.gsub("_", "\\s"), Regexp::IGNORECASE)
|
21
|
+
def str_to_regexp(str)
|
22
|
+
Regexp.new(str.gsub(/\s/, "").gsub("_", "\\s"), Regexp::IGNORECASE)
|
24
23
|
end
|
25
24
|
|
26
25
|
def requirement_check(text)
|
27
26
|
@lang == "en" or return
|
28
|
-
|
29
|
-
|
27
|
+
re = str_to_regexp(self.class::REQUIREMENT_RE_STR)
|
28
|
+
text.gsub(/\s+/, " ").split(/\.\s+/).each do |t|
|
29
|
+
return t if re.match t
|
30
30
|
end
|
31
31
|
nil
|
32
32
|
end
|
@@ -39,15 +39,11 @@ module Metanorma
|
|
39
39
|
\\b
|
40
40
|
REGEXP
|
41
41
|
|
42
|
-
def recommendation_re
|
43
|
-
Regexp.new(self.class::RECOMMENDATION_RE_STR.gsub(/\s/, "")
|
44
|
-
.gsub("_", "\\s"), Regexp::IGNORECASE)
|
45
|
-
end
|
46
|
-
|
47
42
|
def recommendation_check(text)
|
48
43
|
@lang == "en" or return
|
49
|
-
|
50
|
-
|
44
|
+
re = str_to_regexp(self.class::RECOMMENDATION_RE_STR)
|
45
|
+
text.gsub(/\s+/, " ").split(/\.\s+/).each do |t|
|
46
|
+
return t if re.match t
|
51
47
|
end
|
52
48
|
nil
|
53
49
|
end
|
@@ -61,15 +57,11 @@ module Metanorma
|
|
61
57
|
\\b
|
62
58
|
REGEXP
|
63
59
|
|
64
|
-
def permission_re
|
65
|
-
@lang == "en" or return
|
66
|
-
Regexp.new(self.class::PERMISSION_RE_STR.gsub(/\s/, "")
|
67
|
-
.gsub("_", "\\s"), Regexp::IGNORECASE)
|
68
|
-
end
|
69
|
-
|
70
60
|
def permission_check(text)
|
71
|
-
|
72
|
-
|
61
|
+
@lang == "en" or return
|
62
|
+
re = str_to_regexp(self.class::PERMISSION_RE_STR)
|
63
|
+
text.gsub(/\s+/, " ").split(/\.\s+/).each do |t|
|
64
|
+
return t if re.match t
|
73
65
|
end
|
74
66
|
nil
|
75
67
|
end
|
@@ -84,14 +76,10 @@ module Metanorma
|
|
84
76
|
\\b
|
85
77
|
REGEXP
|
86
78
|
|
87
|
-
def possibility_re
|
88
|
-
@lang == "en" or return
|
89
|
-
Regexp.new(self.class::POSSIBILITY_RE_STR.gsub(/\s/, "")
|
90
|
-
.gsub("_", "\\s"), Regexp::IGNORECASE)
|
91
|
-
end
|
92
|
-
|
93
79
|
def possibility_check(text)
|
94
|
-
|
80
|
+
@lang == "en" or return
|
81
|
+
re = str_to_regexp(self.class::POSSIBILITY_RE_STR)
|
82
|
+
text.gsub(/\s+/, " ").split(/\.\s+/).each { |t| return t if re.match t }
|
95
83
|
nil
|
96
84
|
end
|
97
85
|
|
@@ -103,21 +91,31 @@ module Metanorma
|
|
103
91
|
end
|
104
92
|
|
105
93
|
AMBIG_WORDS_RE_STR = <<~REGEXP.freeze
|
106
|
-
\\b
|
107
|
-
need_to | needs_to | might | could
|
108
|
-
\\b
|
94
|
+
\\b(
|
95
|
+
need_to | needs_to | might | could | family_of_standards | suite_of_standards
|
96
|
+
)\\b
|
109
97
|
REGEXP
|
110
98
|
|
111
|
-
def
|
99
|
+
def ambig_words_check(text)
|
112
100
|
@lang == "en" or return
|
113
|
-
|
114
|
-
|
101
|
+
re = str_to_regexp(self.class::AMBIG_WORDS_RE_STR)
|
102
|
+
text.gsub(/\s+/, " ").split(/\.\s+/).each do |t|
|
103
|
+
return t if re.match t
|
104
|
+
end
|
105
|
+
nil
|
115
106
|
end
|
116
107
|
|
117
|
-
|
108
|
+
MISSPELLED_WORDS_RE_STR = <<~REGEXP.freeze
|
109
|
+
\\b(
|
110
|
+
on-line | cyber_security | cyber-security
|
111
|
+
)\\b
|
112
|
+
REGEXP
|
113
|
+
|
114
|
+
def misspelled_words_check(text)
|
118
115
|
@lang == "en" or return
|
119
|
-
|
120
|
-
|
116
|
+
re = str_to_regexp(self.class::MISSPELLED_WORDS_RE_STR)
|
117
|
+
text.gsub(/\s+/, " ").split(/\.\s+/).each do |t|
|
118
|
+
return t if re.match t
|
121
119
|
end
|
122
120
|
nil
|
123
121
|
end
|
@@ -91,7 +91,7 @@ module Metanorma
|
|
91
91
|
style_units(node, text)
|
92
92
|
style_punct(node, text)
|
93
93
|
style_subscript(node)
|
94
|
-
|
94
|
+
style_problem_words(node, text)
|
95
95
|
end
|
96
96
|
|
97
97
|
# https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-s-quantity
|
@@ -107,12 +107,17 @@ module Metanorma
|
|
107
107
|
|
108
108
|
# https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-s-need
|
109
109
|
# https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-s-might
|
110
|
-
|
110
|
+
# https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-s-family
|
111
|
+
# https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-s-it
|
112
|
+
# https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-p-use-of
|
113
|
+
def style_problem_words(node, text)
|
111
114
|
r = ambig_words_check(text) and
|
112
115
|
style_warning(node, "may contain ambiguous provision", r,
|
113
116
|
display: false)
|
114
|
-
|
115
|
-
|
117
|
+
r = misspelled_words_check(text) and
|
118
|
+
style_warning(node, "dispreferred spelling", r,
|
119
|
+
display: false)
|
120
|
+
style_regex(/\b(?<num>billions?)\b/i, "ambiguous number", node, text)
|
116
121
|
end
|
117
122
|
|
118
123
|
# ISO/IEC DIR 2, 9.1
|
@@ -25,7 +25,7 @@ template:
|
|
25
25
|
manual: book
|
26
26
|
techreport: book
|
27
27
|
proceedings: book
|
28
|
-
inbook: "{{ creatornames | selective_upcase }}. ({{role}}) {{ title }} . <em>{{host_title}}</em> ({{host_role}} {{ host_creatornames | replace: '+++', ''}}
|
28
|
+
inbook: "{{ creatornames | selective_upcase }}. ({{role}}) {{ title }} . <em>{{host_title}}</em> ({{host_role}} {{ host_creatornames | replace: '+++', ''}}) . {{ edition | capitalize_first }}. ({{ series }}). {% if place %}{{place}}:{%endif%} {{publisher}}. {{date}}. {{size}}. {{extent}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
29
29
|
inproceedings: inbook
|
30
30
|
incollection: inbook
|
31
31
|
journal: "<em>{{ title}}</em> . {{ edition | capitalize_first }}. {{place}}: {{publisher}}. {{date}}. {{size}}. {{extent}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
data/metanorma-iso.gemspec
CHANGED
@@ -50,5 +50,5 @@ spec.add_development_dependency "rubocop-performance"
|
|
50
50
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
51
51
|
spec.add_development_dependency "timecop", "~> 0.9"
|
52
52
|
spec.add_development_dependency "webmock"
|
53
|
-
spec.add_development_dependency "
|
53
|
+
spec.add_development_dependency "canon"
|
54
54
|
end
|
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: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -249,7 +249,7 @@ dependencies:
|
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '0'
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
|
-
name:
|
252
|
+
name: canon
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
254
254
|
requirements:
|
255
255
|
- - ">="
|