metanorma-iso 3.5.44 → 3.5.46
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/TODO.docx/P0-005-word-unreadable-content.md +3 -1
- data/TODO.docx/P3-007-verify-word-opens.md +4 -1
- data/lib/isodoc/iso/docx/adapter.rb +7 -0
- data/lib/isodoc/iso/docx/core_properties_builder.rb +6 -9
- data/lib/isodoc/iso/docx/custom_xml_items.rb +129 -0
- data/lib/isodoc/iso/docx/importer/front_matter.rb +164 -0
- data/lib/isodoc/iso/docx/importer/reader.rb +144 -0
- data/lib/isodoc/iso/docx/importer.rb +20 -0
- data/lib/isodoc/iso/docx.rb +1 -0
- data/lib/metanorma/iso/log.rb +0 -2
- data/lib/metanorma/iso/validation/rules/base.rb +22 -9
- data/lib/metanorma/iso/validation/rules/style_a_or_an_rule.rb +5 -4
- data/lib/metanorma/iso/validation/rules/style_assure_ensure_rule.rb +74 -19
- data/lib/metanorma/iso/validation/rules/style_non_si_order_rule.rb +39 -36
- data/lib/metanorma/iso/validation/rules/style_rule.rb +16 -2
- data/lib/metanorma/iso/validation/rules/style_words_digits_rule.rb +27 -13
- data/lib/metanorma/iso/validation/rules.rb +0 -2
- data/lib/metanorma/iso/validation/unit_tokens.rb +225 -0
- data/lib/metanorma/iso/validation.rb +1 -0
- data/lib/metanorma/iso/validation_policy/metanorma.yml +0 -2
- data/lib/metanorma/iso/version.rb +1 -1
- metadata +6 -2
- data/lib/metanorma/iso/validation/rules/style_abbrev_articles_rule.rb +0 -47
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Metanorma
|
|
4
|
-
module Iso
|
|
5
|
-
module Validation
|
|
6
|
-
module Rules
|
|
7
|
-
# Style warnings for wrong indefinite articles before
|
|
8
|
-
# initialisms (ISO House Style): initialisms pronounced
|
|
9
|
-
# letter-wise take "an" ("an ISO standard", "an XML file"),
|
|
10
|
-
# not "a".
|
|
11
|
-
#
|
|
12
|
-
# The list below is closed and conservative: only initialisms
|
|
13
|
-
# whose English pronunciation begins with a letter name
|
|
14
|
-
# ("gee", "you", "ess", ...) are flagged, so "a GPS", "a UN",
|
|
15
|
-
# "a SQL" and friends are reported. The reverse direction
|
|
16
|
-
# ("an RFC", "an SAP" read as a word) and acronyms pronounced
|
|
17
|
-
# as words (RAM, NATO) are intentionally out of scope.
|
|
18
|
-
class StyleAbbrevArticlesRule < StyleRule
|
|
19
|
-
code "ISO_63"
|
|
20
|
-
|
|
21
|
-
policy category: "Grammar > A or an",
|
|
22
|
-
rule: "use 'an' before an abbreviated term beginning with a vowel sound ('an ISO standard', 'an XML file')",
|
|
23
|
-
source: :house_style, mn_category: :style
|
|
24
|
-
|
|
25
|
-
# Consonant-letter-name initialisms (PDF "pee", JPG "jay",
|
|
26
|
-
# GPS "jee", UN "you") take "a" and are NOT listed; the list
|
|
27
|
-
# is strictly vowel-letter-name initialisms.
|
|
28
|
-
LETTER_PRONOUNCED = %w[
|
|
29
|
-
GPS UN URN ERP HR SQL API ISO HTML XML RGB RPG SAP
|
|
30
|
-
RPM RSA SLA UML URL
|
|
31
|
-
].freeze
|
|
32
|
-
|
|
33
|
-
A_ARTICLE_REGEX =
|
|
34
|
-
/\ba\s+(?:#{LETTER_PRONOUNCED.join("|")})\b/.freeze
|
|
35
|
-
|
|
36
|
-
def scan_text(node, text)
|
|
37
|
-
findings_for_matches(
|
|
38
|
-
node, text, A_ARTICLE_REGEX,
|
|
39
|
-
"wrong article '%s': this initialism is pronounced " \
|
|
40
|
-
"letter-wise — use 'an'"
|
|
41
|
-
)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|