metanorma-iec 1.4.2 → 2.0.0
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/.github/workflows/rake.yml +4 -32
- data/.gitignore +14 -0
- data/Gemfile +6 -0
- data/Rakefile +1 -1
- data/lib/isodoc/iec/base_convert.rb +25 -59
- data/lib/isodoc/iec/html/htmlstyle.css +38 -6
- data/lib/isodoc/iec/html/htmlstyle.scss +35 -6
- data/lib/isodoc/iec/html/isodoc.css +1 -2
- data/lib/isodoc/iec/html/isodoc.scss +1 -2
- data/lib/isodoc/iec/html/scripts.html +0 -1
- data/lib/isodoc/iec/html/wordstyle.css +13 -11
- data/lib/isodoc/iec/html/wordstyle.scss +13 -11
- data/lib/isodoc/iec/html_convert.rb +2 -1
- data/lib/isodoc/iec/iec.international-standard.xsl +724 -330
- data/lib/isodoc/iec/presentation_xml_convert.rb +193 -5
- data/lib/isodoc/iec/xref.rb +9 -8
- data/lib/{asciidoctor → metanorma}/iec/basicdoc.rng +0 -0
- data/lib/{asciidoctor → metanorma}/iec/biblio.rng +0 -0
- data/lib/metanorma/iec/converter.rb +143 -0
- data/lib/{asciidoctor → metanorma}/iec/front.rb +3 -4
- data/lib/{asciidoctor → metanorma}/iec/iec.rng +48 -0
- data/lib/{asciidoctor → metanorma}/iec/iec_intro_en.xml +0 -0
- data/lib/{asciidoctor → metanorma}/iec/iec_intro_fr.xml +0 -0
- data/lib/{asciidoctor → metanorma}/iec/isodoc.rng +90 -18
- data/lib/{asciidoctor → metanorma}/iec/isostandard.rng +14 -0
- data/lib/metanorma/iec/processor.rb +15 -8
- data/lib/{asciidoctor → metanorma}/iec/reqt.rng +0 -0
- data/lib/metanorma/iec/version.rb +1 -1
- data/lib/metanorma-iec.rb +1 -1
- data/metanorma-iec.gemspec +3 -3
- data/spec/isodoc/iev_spec.rb +462 -120
- data/spec/isodoc/postproc_spec.rb +2 -5
- data/spec/isodoc/ref_spec.rb +359 -353
- data/spec/isodoc/terms_spec.rb +183 -181
- data/spec/{asciidoctor → metanorma}/base_spec.rb +1 -5
- data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
- data/spec/metanorma/cleanup_spec.rb +374 -0
- data/spec/metanorma/iev_spec.rb +248 -0
- data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
- data/spec/metanorma/processor_spec.rb +139 -44
- data/spec/{asciidoctor → metanorma}/section_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/validate_spec.rb +1 -1
- data/spec/spec_helper.rb +12 -14
- metadata +26 -26
- data/lib/asciidoctor/iec/converter.rb +0 -105
- data/spec/asciidoctor/cleanup_spec.rb +0 -345
- data/spec/asciidoctor/iev_spec.rb +0 -243
data/spec/isodoc/iev_spec.rb
CHANGED
@@ -64,8 +64,13 @@ RSpec.describe IsoDoc do
|
|
64
64
|
</body>
|
65
65
|
</html>
|
66
66
|
OUTPUT
|
67
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
68
|
-
|
67
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
68
|
+
.convert("test", input, true)
|
69
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
70
|
+
.to be_equivalent_to xmlpp(presxml)
|
71
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
72
|
+
.convert("test", presxml, true)))
|
73
|
+
.to be_equivalent_to xmlpp(html)
|
69
74
|
end
|
70
75
|
|
71
76
|
it "processes bibliographies under IEV" do
|
@@ -206,6 +211,7 @@ RSpec.describe IsoDoc do
|
|
206
211
|
<formattedref format='application/x-isodoc+xml'>
|
207
212
|
<em>TITLE</em>
|
208
213
|
</formattedref>
|
214
|
+
<docidentifier type='metanorma-ordinal'>[1]</docidentifier>
|
209
215
|
<docidentifier>B</docidentifier>
|
210
216
|
</bibitem>
|
211
217
|
</references>
|
@@ -227,8 +233,13 @@ RSpec.describe IsoDoc do
|
|
227
233
|
</body>
|
228
234
|
</html>
|
229
235
|
OUTPUT
|
230
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
231
|
-
|
236
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
237
|
+
.convert("test", input, true)
|
238
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
239
|
+
.to be_equivalent_to xmlpp(presxml)
|
240
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
241
|
+
.convert("test", presxml, true)))
|
242
|
+
.to be_equivalent_to xmlpp(html)
|
232
243
|
end
|
233
244
|
|
234
245
|
it "processes IEV terms" do
|
@@ -241,8 +252,8 @@ RSpec.describe IsoDoc do
|
|
241
252
|
<sections>
|
242
253
|
<clause id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
|
243
254
|
<terms id="_general" obligation="normative"><title>General</title>
|
244
|
-
<term id="paddy1"><preferred>paddy</preferred>
|
245
|
-
<definition><
|
255
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
|
256
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
246
257
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
247
258
|
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
248
259
|
<ul>
|
@@ -260,11 +271,12 @@ RSpec.describe IsoDoc do
|
|
260
271
|
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
261
272
|
</modification>
|
262
273
|
</termsource></term>
|
263
|
-
<term id="paddy"><preferred>paddy</preferred
|
264
|
-
<admitted>
|
265
|
-
<
|
274
|
+
<term id="paddy"><preferred><expression><name>paddy</name></expression></preferred>
|
275
|
+
<admitted><expression><name>paddy rice</name></expression></admitted>
|
276
|
+
<admitted><expression><name>rough rice</name></expression></admitted>
|
277
|
+
<deprecates><expression><name>cargo rice</name></expression></deprecates>
|
266
278
|
<domain>rice</domain>
|
267
|
-
<definition><
|
279
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
268
280
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
269
281
|
<ul>
|
270
282
|
<li>A</li>
|
@@ -287,6 +299,7 @@ RSpec.describe IsoDoc do
|
|
287
299
|
INPUT
|
288
300
|
|
289
301
|
presxml = <<~INPUT
|
302
|
+
<?xml version='1.0'?>
|
290
303
|
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
291
304
|
<bibdata type='standard'>
|
292
305
|
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
@@ -297,7 +310,7 @@ RSpec.describe IsoDoc do
|
|
297
310
|
<terms id="_general" obligation="normative"><title>192-01 General</title>
|
298
311
|
<term id="paddy1">
|
299
312
|
<name>192-01-01</name>
|
300
|
-
<preferred>paddy</preferred>
|
313
|
+
<preferred><strong>paddy</strong></preferred>
|
301
314
|
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
302
315
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
303
316
|
<name>EXAMPLE 1</name>
|
@@ -312,19 +325,16 @@ RSpec.describe IsoDoc do
|
|
312
325
|
<li>A</li>
|
313
326
|
</ul>
|
314
327
|
</termexample>
|
315
|
-
<termsource status="modified">
|
316
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin
|
317
|
-
|
318
|
-
|
319
|
-
</modification>
|
320
|
-
</termsource></term>
|
328
|
+
<termsource status="modified">SOURCE:
|
329
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>, modified –
|
330
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</termsource>
|
331
|
+
</term>
|
321
332
|
<term id="paddy">
|
322
333
|
<name>192-01-02</name>
|
323
|
-
<preferred>paddy</preferred><admitted>paddy rice</admitted>
|
334
|
+
<preferred><strong>paddy</strong></preferred><admitted>paddy rice</admitted>
|
324
335
|
<admitted>rough rice</admitted>
|
325
336
|
<deprecates>cargo rice</deprecates>
|
326
|
-
<
|
327
|
-
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
337
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p></definition>
|
328
338
|
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
329
339
|
<name>EXAMPLE</name>
|
330
340
|
<ul>
|
@@ -340,7 +350,7 @@ RSpec.describe IsoDoc do
|
|
340
350
|
<ul><li>A</li></ul>
|
341
351
|
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
342
352
|
</termnote>
|
343
|
-
<termsource status="identical">
|
353
|
+
<termsource status="identical">SOURCE:
|
344
354
|
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
345
355
|
</termsource></term>
|
346
356
|
</terms>
|
@@ -356,87 +366,95 @@ RSpec.describe IsoDoc do
|
|
356
366
|
<div class='boilerplate_legal'/>
|
357
367
|
</div>
|
358
368
|
#{IEC_TITLE1}
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
369
|
+
<div id='_terms_and_definitions'>
|
370
|
+
<h1>1  Terms and definitions</h1>
|
371
|
+
<br/>
|
372
|
+
<div id='_general'>
|
373
|
+
<h2 class='zzSTDTitle2'>
|
374
|
+
<b>192-01 General</b>
|
375
|
+
</h2>
|
376
|
+
<p class='TermNum' id='paddy1'>192-01-01</p>
|
377
|
+
<p class='Terms' style='text-align:left;'>
|
378
|
+
<b>paddy</b>
|
379
|
+
</p>
|
380
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
381
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' class='example'>
|
382
|
+
<p>
|
383
|
+
<span class='example_label'>EXAMPLE 1</span>
|
384
|
+
  Foreign seeds, husks, bran, sand, dust.
|
385
|
+
</p>
|
386
|
+
<ul>
|
387
|
+
<li>A</li>
|
388
|
+
</ul>
|
389
|
+
</div>
|
390
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f894' class='example'>
|
391
|
+
<p>
|
392
|
+
<span class='example_label'>EXAMPLE 2</span>
|
393
|
+
 
|
394
|
+
</p>
|
395
|
+
<ul>
|
396
|
+
<li>A</li>
|
397
|
+
</ul>
|
398
|
+
</div>
|
399
|
+
<p>
|
400
|
+
SOURCE:
|
401
|
+
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
402
|
+
, modified – The term "cargo rice" is shown as deprecated, and
|
403
|
+
Note 1 to entry is not included here
|
404
|
+
</p>
|
405
|
+
<p class='TermNum' id='paddy'>192-01-02</p>
|
406
|
+
<p class='Terms' style='text-align:left;'>
|
407
|
+
<b>paddy</b>
|
408
|
+
</p>
|
409
|
+
<p class='AltTerms' style='text-align:left;'>paddy rice</p>
|
410
|
+
<p class='AltTerms' style='text-align:left;'>rough rice</p>
|
411
|
+
<p class='DeprecatedTerms' style='text-align:left;'>DEPRECATED: cargo rice</p>
|
412
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'><rice> rice retaining its husk after threshing</p>
|
413
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f893' class='example'>
|
414
|
+
<p>
|
415
|
+
<span class='example_label'>EXAMPLE</span>
|
416
|
+
 
|
417
|
+
</p>
|
418
|
+
<ul>
|
419
|
+
<li>A</li>
|
420
|
+
</ul>
|
421
|
+
</div>
|
422
|
+
<div id='_671a1994-4783-40d0-bc81-987d06ffb74e' class='Note'>
|
423
|
+
<p>
|
424
|
+
Note 1 to entry: The starch of waxy rice consists almost entirely
|
425
|
+
of amylopectin. The kernels have a tendency to stick together
|
426
|
+
after cooking.
|
427
|
+
</p>
|
428
|
+
</div>
|
429
|
+
<div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class='Note'>
|
430
|
+
<p>
|
431
|
+
Note 2 to entry:
|
432
|
+
<ul>
|
433
|
+
<li>A</li>
|
434
|
+
</ul>
|
435
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
436
|
+
The starch of waxy rice consists almost entirely of amylopectin.
|
437
|
+
The kernels have a tendency to stick together after cooking.
|
438
|
+
</p>
|
439
|
+
</p>
|
440
|
+
</div>
|
441
|
+
<p>
|
442
|
+
SOURCE:
|
443
|
+
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
444
|
+
</p>
|
445
|
+
</div>
|
446
|
+
</div>
|
447
|
+
</div>
|
448
|
+
</body>
|
449
|
+
</html>
|
437
450
|
OUTPUT
|
438
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
439
|
-
|
451
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
452
|
+
.convert("test", input, true)
|
453
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
454
|
+
.to be_equivalent_to xmlpp(presxml)
|
455
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({})
|
456
|
+
.convert("test", presxml, true)))
|
457
|
+
.to be_equivalent_to xmlpp(html)
|
440
458
|
end
|
441
459
|
|
442
460
|
it "populates Word template with terms reference labels" do
|
@@ -451,8 +469,8 @@ RSpec.describe IsoDoc do
|
|
451
469
|
<sections>
|
452
470
|
<clause id="_terms_and_definitions" obligation="normative" displayorder="1"><title>Terms and definitions</title>
|
453
471
|
<terms id="_general" obligation="normative"><title>General</title>
|
454
|
-
<term id="paddy1"><preferred>paddy</preferred>
|
455
|
-
<definition><
|
472
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
|
473
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbal-definition></definition>
|
456
474
|
<termsource status="modified">
|
457
475
|
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
458
476
|
<modification>
|
@@ -477,23 +495,16 @@ RSpec.describe IsoDoc do
|
|
477
495
|
<title>192-01 General</title>
|
478
496
|
<term id='paddy1'>
|
479
497
|
<name>192-01-01</name>
|
480
|
-
<preferred>paddy</preferred>
|
498
|
+
<preferred><strong>paddy</strong></preferred>
|
481
499
|
<definition>
|
482
500
|
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
483
501
|
</definition>
|
484
|
-
<termsource status='modified'>
|
485
|
-
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
|
486
|
-
<locality type='clause'>
|
502
|
+
<termsource status='modified'>SOURCE:
|
503
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'><locality type='clause'>
|
487
504
|
<referenceFrom>3.1</referenceFrom>
|
488
|
-
</locality>
|
489
|
-
ISO 7301:2011, 3.1
|
490
|
-
</origin>
|
491
|
-
<modification>
|
492
|
-
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
505
|
+
</locality>ISO 7301:2011, 3.1</origin>, modified –
|
493
506
|
The term "cargo rice" is shown as deprecated, and Note 1 to
|
494
507
|
entry is not included here
|
495
|
-
</p>
|
496
|
-
</modification>
|
497
508
|
</termsource>
|
498
509
|
</term>
|
499
510
|
</terms>
|
@@ -501,9 +512,13 @@ RSpec.describe IsoDoc do
|
|
501
512
|
</sections>
|
502
513
|
</iso-standard>
|
503
514
|
OUTPUT
|
504
|
-
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
515
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
516
|
+
.convert("test", input, true)
|
517
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
518
|
+
.to be_equivalent_to xmlpp(presxml)
|
505
519
|
IsoDoc::Iec::WordConvert.new({}).convert("test", presxml, false)
|
506
|
-
word = File.read("test.doc")
|
520
|
+
word = File.read("test.doc")
|
521
|
+
.sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
|
507
522
|
.sub(%r{<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>.*$}m, "")
|
508
523
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
509
524
|
<div class='WordSection3'>
|
@@ -523,14 +538,14 @@ RSpec.describe IsoDoc do
|
|
523
538
|
</p>
|
524
539
|
<div>
|
525
540
|
<a name='_general' id='_general'/>
|
526
|
-
<
|
541
|
+
<h2 class='zzSTDTitle2'>
|
527
542
|
<b>192-01 General</b>
|
528
|
-
</
|
543
|
+
</h2>
|
529
544
|
<p class='TermNum'>
|
530
545
|
<a name='paddy1' id='paddy1'/>
|
531
546
|
192-01-01
|
532
547
|
</p>
|
533
|
-
<p class='Terms' style='text-align:left;'>paddy</p>
|
548
|
+
<p class='Terms' style='text-align:left;'><b>paddy</b></p>
|
534
549
|
<p class='MsoNormal'>
|
535
550
|
<a name='_eb29b35e-123e-4d1c-b50b-2714d41e747f' id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'/>
|
536
551
|
rice retaining its husk after threshing
|
@@ -538,7 +553,7 @@ RSpec.describe IsoDoc do
|
|
538
553
|
<p class='MsoNormal'>
|
539
554
|
SOURCE:
|
540
555
|
<a href='#ISO7301'>ISO 7301:2011, 3.1</a>
|
541
|
-
, modified &#
|
556
|
+
, modified – The term "cargo rice" is shown as deprecated, and
|
542
557
|
Note 1 to entry is not included here
|
543
558
|
</p>
|
544
559
|
</div>
|
@@ -546,4 +561,331 @@ RSpec.describe IsoDoc do
|
|
546
561
|
</div>
|
547
562
|
OUTPUT
|
548
563
|
end
|
564
|
+
|
565
|
+
it "convert termbase references to the current document to xrefs" do
|
566
|
+
input = <<~INPUT
|
567
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
568
|
+
<bibdata type='standard'>
|
569
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
570
|
+
<docnumber>60050</docnumber>
|
571
|
+
<ext>
|
572
|
+
<doctype>international-standard</doctype>
|
573
|
+
<horizontal>false</horizontal>
|
574
|
+
<structuredidentifier>
|
575
|
+
<project-number part="192">IEC 60050</project-number>
|
576
|
+
</structuredidentifier>
|
577
|
+
<stagename>International standard</stagename>
|
578
|
+
</ext>
|
579
|
+
</bibdata>
|
580
|
+
<sections>
|
581
|
+
<clause id="_terms_and_definitions" obligation="normative" displayorder="1"><title>Terms and definitions</title>
|
582
|
+
<terms id="_general" obligation="normative"><title>General</title>
|
583
|
+
<term id="term-durability"><preferred><expression><name>durability</name></expression><field-of-application>of an item</field-of-application></preferred>
|
584
|
+
<definition><verbaldefinition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></verbaldefinition></definition>
|
585
|
+
<termnote id="_5f49cfad-e57e-5029-78cf-5b7e3e10a3b3">
|
586
|
+
<p id="_8c830e60-8f09-73a2-6393-2a27d9c5b1ce">Dependability includes availability (<concept><refterm>192-01-02</refterm><renderterm>192-01-02</renderterm><termref base="IEV" target="192-01-02"/></concept>, <concept><refterm>191-01-02</refterm><renderterm>191-01-02</renderterm><termref base="IEV" target="191-01-02"/></concept>)</p>
|
587
|
+
</termnote>
|
588
|
+
</term>
|
589
|
+
<term id="term-sub-item"><preferred><expression><name>sub item</name></expression></preferred><definition><verbal-definition><p id="_6952e988-8803-159d-a32e-57147fbf3d86">part of the subject being considered</p></verbal-definition></definition>
|
590
|
+
</term>
|
591
|
+
</terms>
|
592
|
+
</clause>
|
593
|
+
</sections>
|
594
|
+
</iso-standard>
|
595
|
+
INPUT
|
596
|
+
presxml = <<~PRESXML
|
597
|
+
<?xml version='1.0'?>
|
598
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
599
|
+
<bibdata type='standard'>
|
600
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
601
|
+
<docnumber>60050</docnumber>
|
602
|
+
<ext>
|
603
|
+
<doctype language=''>international-standard</doctype>
|
604
|
+
<doctype language='fr'>Norme international</doctype>
|
605
|
+
<doctype language='en'>International Standard</doctype>
|
606
|
+
<horizontal language=''>false</horizontal>
|
607
|
+
<structuredidentifier>
|
608
|
+
<project-number part='192'>IEC 60050</project-number>
|
609
|
+
</structuredidentifier>
|
610
|
+
<stagename>International standard</stagename>
|
611
|
+
</ext>
|
612
|
+
</bibdata>
|
613
|
+
<sections>
|
614
|
+
<clause id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
615
|
+
<title depth='1'>1<tab/>Terms and definitions</title>
|
616
|
+
<terms id='_general' obligation='normative'>
|
617
|
+
<title>192-01 General</title>
|
618
|
+
<term id='term-durability'>
|
619
|
+
<name>192-01-01</name>
|
620
|
+
<preferred><strong>durability</strong>, <of an item></preferred>
|
621
|
+
<definition>
|
622
|
+
<verbaldefinition>
|
623
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
624
|
+
</verbaldefinition>
|
625
|
+
</definition>
|
626
|
+
<termnote id='_5f49cfad-e57e-5029-78cf-5b7e3e10a3b3'>
|
627
|
+
<name>Note 1 to entry</name>
|
628
|
+
<p id='_8c830e60-8f09-73a2-6393-2a27d9c5b1ce'>Dependability includes availability (<em>192-01-02</em>
|
629
|
+
(<xref target='term-sub-item'>192-01-02</xref>),
|
630
|
+
<em>191-01-02</em>
|
631
|
+
[term defined in
|
632
|
+
<termref base='IEV' target='191-01-02'/>])</p>
|
633
|
+
</termnote>
|
634
|
+
</term>
|
635
|
+
<term id='term-sub-item'>
|
636
|
+
<name>192-01-02</name>
|
637
|
+
<preferred><strong>sub item</strong></preferred>
|
638
|
+
<definition>
|
639
|
+
<p id='_6952e988-8803-159d-a32e-57147fbf3d86'>part of the subject being considered</p>
|
640
|
+
</definition>
|
641
|
+
</term>
|
642
|
+
</terms>
|
643
|
+
</clause>
|
644
|
+
</sections>
|
645
|
+
</iso-standard>
|
646
|
+
PRESXML
|
647
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
648
|
+
.convert("test", input, true)
|
649
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
650
|
+
.to be_equivalent_to xmlpp(presxml)
|
651
|
+
end
|
652
|
+
|
653
|
+
it "processes multilingual IEV terms" do
|
654
|
+
input = <<~INPUT
|
655
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
656
|
+
<bibdata type='standard'>
|
657
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
658
|
+
<docnumber>60050</docnumber>
|
659
|
+
</bibdata>
|
660
|
+
<sections>
|
661
|
+
<clause id="_terms_and_definitions" obligation="normative"><title>Terms and definitions</title>
|
662
|
+
<terms id="_general" obligation="normative"><title>General</title>
|
663
|
+
<term id="item" language="en" tag="item">
|
664
|
+
<preferred><expression language="en"><name>system</name></expression><field-of-application>in dependability</field-of-application></preferred>
|
665
|
+
<preferred><expression language="de"><name>Betrachtungseinheit</name<grammar><gender>feminine</gender></grammar></expression></preferred>
|
666
|
+
<preferred><expression language="ja"><name>アイテム</name></expression></preferred>
|
667
|
+
<preferred><expression language="de"><name>Einheit</name><grammar><gender>feminine</gender></grammar></expression></preferred>
|
668
|
+
<preferred><expression language="zh"><name>产品</name></expression><field-of-application>在可靠性方面</field-of-application></preferred>
|
669
|
+
<preferred><expression language="ar"><name>نظام،</name></expression><field-of-application>في الاعتمادیة</field-of-application></preferred>
|
670
|
+
<admitted><expression><name>paddy rice</name></expression></admitted>
|
671
|
+
<admitted><expression><name>rough rice</name></expression></admitted>
|
672
|
+
<deprecates><expression><name>cargo rice</name></expression></deprecates>
|
673
|
+
<related type='contrast'><preferred><expression><name>Fifth Designation</name></expression></preferred><xref target="paddy1"/></related>
|
674
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">set of interrelated items that collectively fulfil a requirement</p></verbal-definition></definition>
|
675
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
676
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">A system is considered to have a defined real or abstract boundary.</p>
|
677
|
+
</termnote>
|
678
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74d">
|
679
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">External resources (from outside the system boundary) may be required for the system to operate.</p>
|
680
|
+
</termnote>
|
681
|
+
<termexample id="_671a1994-4783-40d0-bc81-987d06ffb740">
|
682
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d0">External resources (from outside the system boundary) may be required for the system to operate.</p>
|
683
|
+
</termexample>
|
684
|
+
<termsource status="modified">
|
685
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
686
|
+
<modification>modified by extension to suit the dependability context</modification>
|
687
|
+
</termsource></term>
|
688
|
+
<term id="item-fr" language="fr" tag="item">
|
689
|
+
<preferred><expression language="fr"><name>entité</name<grammar><gender>masculine</gender></grammar></expression>
|
690
|
+
<field-of-application>en sûreté de fonctionnement</field-of-application>
|
691
|
+
</preferred>
|
692
|
+
<related type='contrast'><preferred><expression><name>Designation cinquième</name></expression></preferred><xref target="paddy1"/></related>
|
693
|
+
<related type='see'><preferred><expression><name>Designation sixième</name></expression></preferred><xref target="paddy1"/></related>
|
694
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747d">ensemble d’entités reliées entre elles qui satisfont collectivement à une exigence</p></verbal-definition></definition>
|
695
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74c">
|
696
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">Un système est considéré comme ayant une frontière définie, réelle ou abstraite.</p>
|
697
|
+
</termnote>
|
698
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74b">
|
699
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">Des ressources externes (provenant d’au-delà de la frontière) peuvent être nécessaires au fonctionnement du système.</p>
|
700
|
+
</termnote>
|
701
|
+
<termexample id="_671a1994-4783-40d0-bc81-987d06ffb741">
|
702
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d1">External resources (from outside the system boundary) may be required for the system to operate.</p>
|
703
|
+
</termexample>
|
704
|
+
<termsource status="modified">
|
705
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
706
|
+
<modification>modifié pour adapter au contexte de la sûreté de fonctionnement</modification>
|
707
|
+
</termsource></term>
|
708
|
+
<term id="paddy1"><preferred><expression><name>paddy</name></expression></preferred>
|
709
|
+
<definition><verbal-definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747d">rice retaining its husk after threshing</p></verbal-definition></definition>
|
710
|
+
</term>
|
711
|
+
</terms>
|
712
|
+
</clause>
|
713
|
+
</sections>
|
714
|
+
</iso-standard>
|
715
|
+
INPUT
|
716
|
+
|
717
|
+
presxml = <<~PRESXML
|
718
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
719
|
+
<bibdata type='standard'>
|
720
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
721
|
+
<docnumber>60050</docnumber>
|
722
|
+
</bibdata>
|
723
|
+
<sections>
|
724
|
+
<clause id='_terms_and_definitions' obligation='normative' displayorder='1'>
|
725
|
+
<title depth='1'>
|
726
|
+
1
|
727
|
+
<tab/>
|
728
|
+
Terms and definitions
|
729
|
+
</title>
|
730
|
+
<terms id='_general' obligation='normative'>
|
731
|
+
<title>192-01 General</title>
|
732
|
+
<term id='item' language='en,fr'>
|
733
|
+
<name>192-01-01</name>
|
734
|
+
<preferred>
|
735
|
+
<strong>system</strong>
|
736
|
+
, <in dependability>
|
737
|
+
</preferred>
|
738
|
+
<admitted>paddy rice</admitted>
|
739
|
+
<admitted>rough rice</admitted>
|
740
|
+
<deprecates>cargo rice</deprecates>
|
741
|
+
<definition>
|
742
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>set of interrelated items that collectively fulfil a requirement</p>
|
743
|
+
</definition>
|
744
|
+
<p>
|
745
|
+
CONTRAST:
|
746
|
+
<strong>Fifth Designation</strong>
|
747
|
+
(
|
748
|
+
<xref target='paddy1'>192-01-02</xref>
|
749
|
+
)
|
750
|
+
</p>
|
751
|
+
<termexample id='_671a1994-4783-40d0-bc81-987d06ffb740'>
|
752
|
+
<name>EXAMPLE</name>
|
753
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d0'>
|
754
|
+
External resources (from outside the system boundary) may be
|
755
|
+
required for the system to operate.
|
756
|
+
</p>
|
757
|
+
</termexample>
|
758
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74e'>
|
759
|
+
<name>Note 1 to entry</name>
|
760
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>A system is considered to have a defined real or abstract boundary.</p>
|
761
|
+
</termnote>
|
762
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74d'>
|
763
|
+
<name>Note 2 to entry</name>
|
764
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
765
|
+
External resources (from outside the system boundary) may be
|
766
|
+
required for the system to operate.
|
767
|
+
</p>
|
768
|
+
</termnote>
|
769
|
+
<termsource status='modified'>
|
770
|
+
SOURCE:
|
771
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
|
772
|
+
<locality type='clause'>
|
773
|
+
<referenceFrom>3.1</referenceFrom>
|
774
|
+
</locality>
|
775
|
+
ISO 7301:2011, 3.1
|
776
|
+
</origin>
|
777
|
+
, modified – modified by extension to suit the dependability
|
778
|
+
context
|
779
|
+
</termsource>
|
780
|
+
<preferred>
|
781
|
+
<strong>entité</strong>
|
782
|
+
, <en sûreté de fonctionnement>, m
|
783
|
+
</preferred>
|
784
|
+
<definition>
|
785
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747d'>
|
786
|
+
ensemble d’entités reliées entre elles qui
|
787
|
+
satisfont collectivement à une exigence
|
788
|
+
</p>
|
789
|
+
</definition>
|
790
|
+
<p>
|
791
|
+
CONTRASTEZ:
|
792
|
+
<strong>Designation cinquième</strong>
|
793
|
+
(
|
794
|
+
<xref target='paddy1'>192-01-02</xref>
|
795
|
+
)
|
796
|
+
</p>
|
797
|
+
<p>
|
798
|
+
VOIR:
|
799
|
+
<strong>Designation sixième</strong>
|
800
|
+
(
|
801
|
+
<xref target='paddy1'>192-01-02</xref>
|
802
|
+
)
|
803
|
+
</p>
|
804
|
+
<termexample id='_671a1994-4783-40d0-bc81-987d06ffb741'>
|
805
|
+
<name>EXEMPLE</name>
|
806
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d1'>
|
807
|
+
External resources (from outside the system boundary) may be
|
808
|
+
required for the system to operate.
|
809
|
+
</p>
|
810
|
+
</termexample>
|
811
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74c'>
|
812
|
+
<name>Note 1 à l’article</name>
|
813
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
814
|
+
Un système est considéré comme ayant une
|
815
|
+
frontière définie, réelle ou abstraite.
|
816
|
+
</p>
|
817
|
+
</termnote>
|
818
|
+
<termnote id='_671a1994-4783-40d0-bc81-987d06ffb74b'>
|
819
|
+
<name>Note 2 à l’article</name>
|
820
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
821
|
+
Des ressources externes (provenant d’au-delà de la
|
822
|
+
frontière) peuvent être nécessaires au
|
823
|
+
fonctionnement du système.
|
824
|
+
</p>
|
825
|
+
</termnote>
|
826
|
+
<termsource status='modified'>
|
827
|
+
SOURCE:
|
828
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
|
829
|
+
<locality type='clause'>
|
830
|
+
<referenceFrom>3.1</referenceFrom>
|
831
|
+
</locality>
|
832
|
+
ISO 7301:2011, 3.1
|
833
|
+
</origin>
|
834
|
+
, modifié – modifié pour adapter au contexte de la
|
835
|
+
sûreté de fonctionnement
|
836
|
+
</termsource>
|
837
|
+
<dl type='other-lang'>
|
838
|
+
<dt>ar</dt>
|
839
|
+
<dd language='ar' script='Arab'>
|
840
|
+
<preferred>
|
841
|
+
<strong>؜نظام،؜</strong>
|
842
|
+
؜, <في
|
843
|
+
الاعتمادیة>؜
|
844
|
+
</preferred>
|
845
|
+
</dd>
|
846
|
+
<dt>de</dt>
|
847
|
+
<dd language='de' script='Latn'>
|
848
|
+
<preferred>
|
849
|
+
<strong>Betrachtungseinheit</strong>
|
850
|
+
, f
|
851
|
+
</preferred>
|
852
|
+
<preferred>
|
853
|
+
<strong>Einheit</strong>
|
854
|
+
, f
|
855
|
+
</preferred>
|
856
|
+
</dd>
|
857
|
+
<dt>ja</dt>
|
858
|
+
<dd language='ja' script='Jpan'>
|
859
|
+
<preferred>
|
860
|
+
<strong>アイテム</strong>
|
861
|
+
</preferred>
|
862
|
+
</dd>
|
863
|
+
<dt>zh</dt>
|
864
|
+
<dd language='zh' script='Hans'>
|
865
|
+
<preferred>
|
866
|
+
<strong>产品</strong>
|
867
|
+
、<在可靠性方面>
|
868
|
+
</preferred>
|
869
|
+
</dd>
|
870
|
+
</dl>
|
871
|
+
</term>
|
872
|
+
<term id='paddy1'>
|
873
|
+
<name>192-01-02</name>
|
874
|
+
<preferred>
|
875
|
+
<strong>paddy</strong>
|
876
|
+
</preferred>
|
877
|
+
<definition>
|
878
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747d'>rice retaining its husk after threshing</p>
|
879
|
+
</definition>
|
880
|
+
</term>
|
881
|
+
</terms>
|
882
|
+
</clause>
|
883
|
+
</sections>
|
884
|
+
</iso-standard>
|
885
|
+
PRESXML
|
886
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
|
887
|
+
.convert("test", input, true)
|
888
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
889
|
+
.to be_equivalent_to xmlpp(presxml)
|
890
|
+
end
|
549
891
|
end
|