metanorma-iso 3.5.9 → 3.5.10

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: 56ebff6e86f4d5345ed62391ab5aa6c6ef0a94dfe73838e9f159b1cdbc068e38
4
- data.tar.gz: fcff163b4d8ca5983f99bf703e14c30a972cbd48293a81fe04b88ee7d40fd37e
3
+ metadata.gz: 347459919f1dd0543b2615788d5cfffe60e4a2ac085e590bf86dcc7942ff852b
4
+ data.tar.gz: 385581e5a36d6b1e05214d4e5c3893c3db7726371f244c5d20063cd02b47da7b
5
5
  SHA512:
6
- metadata.gz: 2f83587dc8e9a52722986e379101bebd264db5d58a70169de9cef66398d03df8814ebe63773a098ddc70045d79d6c4130d6be058dbc8b39c2bb33f49d7a87eac
7
- data.tar.gz: 31aa9615f20c3d3a4d983f2b23760d21d6ac37227620b31c9d5f24526eb76378d217eb229e8d652fd3019a3be3940698da4b850a5f400a1fe2371557f9464a49
6
+ metadata.gz: 747c6b2f38cc767d8db6a1ce40855e4a9fdb4fa93a6dfbf578b7366a98b1cddc90d48fa977582291e876b0142eef151d1b77d21481be37661fdcf33a407f7935
7
+ data.tar.gz: b6033b636007d30d74a278d398d24eccdeba7f7f8ed36bba2fcf6675283d5ef98de8b768f8ee08a15fde300302068a05e2832b9dc50354be3f07369e94f6a477
@@ -326,11 +326,19 @@ module Metanorma
326
326
  @doc_anchor_seq << elem["anchor"]
327
327
  end
328
328
 
329
+ # The flavor identity of this validator, declared by each flavor
330
+ # subclass (metanorma-bsi declares "bsi"). Validation rules consult
331
+ # it to defer concerns the flavor owns (e.g. decimal conventions).
332
+ def validation_flavor
333
+ "iso"
334
+ end
335
+
329
336
  def model_validate(doc)
330
337
  state = Metanorma::Iso::Validation::ConverterState.new(
331
338
  lang: @lang, script: @script, doctype: @doctype,
332
339
  vocab: @vocab, amd: @amd, i18n: @i18n,
333
- novalid: @novalid, document: @localdir
340
+ novalid: @novalid, document: @localdir,
341
+ flavor: validation_flavor
334
342
  )
335
343
  # ModelValidator deserializes the full document into a typed model
336
344
  # tree — for large documents that tree is gigabytes on top of the
@@ -9,7 +9,7 @@ module Metanorma
9
9
  # converter internals via +instance_variable_get+.
10
10
  ConverterState = Struct.new(
11
11
  :lang, :script, :doctype, :vocab, :amd, :i18n, :novalid, :document,
12
- keyword_init: true
12
+ :flavor, keyword_init: true
13
13
  )
14
14
  end
15
15
  end
@@ -17,11 +17,28 @@ module Metanorma
17
17
  DECIMAL_POINT_REGEX = /(?:^|\p{Zs})([0-9]+\.[0-9]+)(?!\.[0-9])/i.freeze
18
18
  HYPHEN_MINUS_REGEX = /(?:^|\p{Zs})(-[0-9][0-9,.]*)/i.freeze
19
19
 
20
+ # Flavors whose structure rules govern decimal conventions
21
+ # themselves (metanorma-bsi's 27.x euro-annex regimes) own this
22
+ # concern; the ISO-generic scan would double-report and contradict
23
+ # the flavor's own verdicts.
24
+ DECIMAL_POINT_FLAVOR_OWNERS = %w(bsi).freeze
25
+
26
+ def check(context)
27
+ @validation_flavor = context.state&.flavor
28
+ super
29
+ end
30
+
20
31
  def scan_text(node, text)
21
- findings_for_matches(node, text, DECIMAL_POINT_REGEX,
22
- "possible decimal point: mark up numbers with stem:[]: %s") +
23
- findings_for_matches(node, text, HYPHEN_MINUS_REGEX,
24
- "hyphen instead of minus sign U+2212: %s")
32
+ decimal = flavor_owns_decimal? ? [] : findings_for_matches(
33
+ node, text, DECIMAL_POINT_REGEX,
34
+ "possible decimal point: mark up numbers with stem:[]: %s",
35
+ )
36
+ decimal + findings_for_matches(node, text, HYPHEN_MINUS_REGEX,
37
+ "hyphen instead of minus sign U+2212: %s")
38
+ end
39
+
40
+ def flavor_owns_decimal?
41
+ DECIMAL_POINT_FLAVOR_OWNERS.include?(@validation_flavor)
25
42
  end
26
43
  end
27
44
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iso
3
- VERSION = "3.5.9".freeze
3
+ VERSION = "3.5.10".freeze
4
4
  end
5
5
  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.5.9
4
+ version: 3.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-10 00:00:00.000000000 Z
11
+ date: 2026-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-document