isodoc 1.6.1 → 1.6.6
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 +2 -12
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/Rakefile +2 -2
- data/isodoc.gemspec +4 -3
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc.rb +0 -2
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +8 -2
- data/lib/isodoc/function/blocks.rb +15 -4
- data/lib/isodoc/function/cleanup.rb +52 -43
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +8 -7
- data/lib/isodoc/function/references.rb +71 -77
- data/lib/isodoc/function/section.rb +28 -16
- data/lib/isodoc/function/table.rb +22 -22
- data/lib/isodoc/function/terms.rb +6 -7
- data/lib/isodoc/function/to_word_html.rb +19 -25
- data/lib/isodoc/function/utils.rb +181 -163
- data/lib/isodoc/gem_tasks.rb +8 -9
- data/lib/isodoc/headlesshtml_convert.rb +8 -7
- data/lib/isodoc/html_convert.rb +6 -0
- data/lib/isodoc/html_function/comments.rb +14 -12
- data/lib/isodoc/html_function/footnotes.rb +14 -7
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/html.rb +30 -26
- data/lib/isodoc/html_function/postprocess.rb +191 -182
- data/lib/isodoc/html_function/sectionsplit.rb +230 -0
- data/lib/isodoc/i18n.rb +13 -11
- data/lib/isodoc/metadata.rb +22 -20
- data/lib/isodoc/metadata_contributor.rb +31 -28
- data/lib/isodoc/pdf_convert.rb +11 -13
- data/lib/isodoc/presentation_function/bibdata.rb +54 -30
- data/lib/isodoc/presentation_function/inline.rb +70 -120
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +55 -19
- data/lib/isodoc/presentation_xml_convert.rb +3 -0
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/postprocess.rb +50 -36
- data/lib/isodoc/xref.rb +2 -0
- data/lib/isodoc/xref/xref_counter.rb +1 -2
- data/lib/isodoc/xref/xref_gen.rb +21 -14
- data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
- data/lib/isodoc/xref/xref_sect_gen.rb +15 -15
- data/spec/assets/scripts_override.html +3 -0
- data/spec/isodoc/blocks_spec.rb +624 -997
- data/spec/isodoc/cleanup_spec.rb +40 -42
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +694 -821
- data/spec/isodoc/inline_spec.rb +1105 -921
- data/spec/isodoc/metadata_spec.rb +384 -379
- data/spec/isodoc/postproc_spec.rb +461 -333
- data/spec/isodoc/presentation_xml_spec.rb +355 -278
- data/spec/isodoc/ref_spec.rb +5 -5
- data/spec/isodoc/section_spec.rb +216 -199
- data/spec/isodoc/sectionsplit_spec.rb +190 -0
- data/spec/isodoc/table_spec.rb +41 -42
- data/spec/isodoc/terms_spec.rb +84 -84
- data/spec/isodoc/xref_spec.rb +974 -932
- metadata +32 -7
@@ -20,36 +20,55 @@ RSpec.describe IsoDoc do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "localises numbers in MathML" do
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
input = <<~INPUT
|
24
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
25
|
+
<bibdata>
|
26
|
+
<title language="en">test</title>
|
27
|
+
</bibdata>
|
28
|
+
<preface>
|
29
|
+
<p>
|
30
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>64212149677264515</mn></math></stem>
|
31
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>642121496772645.15</mn></math></stem>
|
32
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math></stem>
|
33
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>1</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
|
34
|
+
</preface>
|
35
|
+
</iso-standard>
|
36
|
+
INPUT
|
37
|
+
output = <<~OUTPUT
|
38
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
26
39
|
<bibdata>
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
40
|
+
<title language='en'>test</title>
|
41
|
+
</bibdata>
|
42
|
+
<preface>
|
43
|
+
<p displayorder="1">
|
44
|
+
64,212,149,677,264,515
|
45
|
+
642,121,496,772,645.15 30,000
|
46
|
+
<stem type='MathML'>
|
47
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
48
|
+
<mi>P</mi>
|
49
|
+
<mfenced open='(' close=')'>
|
50
|
+
<mrow>
|
51
|
+
<mi>X</mi>
|
52
|
+
<mo>≥</mo>
|
53
|
+
<msub>
|
54
|
+
<mrow>
|
55
|
+
<mi>X</mi>
|
56
|
+
</mrow>
|
57
|
+
<mrow>
|
58
|
+
<mo>max</mo>
|
59
|
+
</mrow>
|
60
|
+
</msub>
|
61
|
+
</mrow>
|
62
|
+
</mfenced>
|
63
|
+
<mo>=</mo>
|
64
|
+
<munderover>
|
65
|
+
<mrow>
|
66
|
+
<mo>∑</mo>
|
67
|
+
</mrow>
|
68
|
+
<mrow>
|
50
69
|
<mrow>
|
51
|
-
<mi>
|
52
|
-
<mo
|
70
|
+
<mi>j</mi>
|
71
|
+
<mo>=</mo>
|
53
72
|
<msub>
|
54
73
|
<mrow>
|
55
74
|
<mi>X</mi>
|
@@ -59,76 +78,61 @@ RSpec.describe IsoDoc do
|
|
59
78
|
</mrow>
|
60
79
|
</msub>
|
61
80
|
</mrow>
|
62
|
-
</
|
63
|
-
<
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
81
|
+
</mrow>
|
82
|
+
<mrow>
|
83
|
+
<mn>1,000</mn>
|
84
|
+
</mrow>
|
85
|
+
</munderover>
|
86
|
+
<mfenced open='(' close=')'>
|
87
|
+
<mtable>
|
88
|
+
<mtr>
|
89
|
+
<mtd>
|
90
|
+
<mn>1,000</mn>
|
91
|
+
</mtd>
|
92
|
+
</mtr>
|
93
|
+
<mtr>
|
94
|
+
<mtd>
|
70
95
|
<mi>j</mi>
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
<mfenced open='(' close=')'>
|
87
|
-
<mtable>
|
88
|
-
<mtr>
|
89
|
-
<mtd>
|
90
|
-
<mn>1,000</mn>
|
91
|
-
</mtd>
|
92
|
-
</mtr>
|
93
|
-
<mtr>
|
94
|
-
<mtd>
|
95
|
-
<mi>j</mi>
|
96
|
-
</mtd>
|
97
|
-
</mtr>
|
98
|
-
</mtable>
|
99
|
-
</mfenced>
|
100
|
-
<msup>
|
101
|
-
<mrow>
|
102
|
-
<mi>p</mi>
|
103
|
-
</mrow>
|
104
|
-
<mrow>
|
105
|
-
<mi>j</mi>
|
106
|
-
</mrow>
|
107
|
-
</msup>
|
108
|
-
<msup>
|
109
|
-
<mrow>
|
110
|
-
<mfenced open='(' close=')'>
|
111
|
-
<mrow>
|
112
|
-
<mn>1</mn>
|
113
|
-
<mo>−</mo>
|
114
|
-
<mi>p</mi>
|
115
|
-
</mrow>
|
116
|
-
</mfenced>
|
117
|
-
</mrow>
|
118
|
-
<mrow>
|
96
|
+
</mtd>
|
97
|
+
</mtr>
|
98
|
+
</mtable>
|
99
|
+
</mfenced>
|
100
|
+
<msup>
|
101
|
+
<mrow>
|
102
|
+
<mi>p</mi>
|
103
|
+
</mrow>
|
104
|
+
<mrow>
|
105
|
+
<mi>j</mi>
|
106
|
+
</mrow>
|
107
|
+
</msup>
|
108
|
+
<msup>
|
109
|
+
<mrow>
|
110
|
+
<mfenced open='(' close=')'>
|
119
111
|
<mrow>
|
120
|
-
<mn>1
|
112
|
+
<mn>1</mn>
|
121
113
|
<mo>−</mo>
|
122
|
-
<mi>
|
114
|
+
<mi>p</mi>
|
123
115
|
</mrow>
|
116
|
+
</mfenced>
|
117
|
+
</mrow>
|
118
|
+
<mrow>
|
119
|
+
<mrow>
|
120
|
+
<mn>1.003</mn>
|
121
|
+
<mo>−</mo>
|
122
|
+
<mi>j</mi>
|
124
123
|
</mrow>
|
125
|
-
</
|
126
|
-
</
|
127
|
-
</
|
128
|
-
</
|
129
|
-
</
|
130
|
-
</
|
131
|
-
|
124
|
+
</mrow>
|
125
|
+
</msup>
|
126
|
+
</math>
|
127
|
+
</stem>
|
128
|
+
</p>
|
129
|
+
</preface>
|
130
|
+
</iso-standard>
|
131
|
+
OUTPUT
|
132
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
133
|
+
.convert("test", input, true))
|
134
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
135
|
+
.to be_equivalent_to xmlpp(output)
|
132
136
|
end
|
133
137
|
|
134
138
|
context "when twitter_cldr_localiser_symbols has additional options" do
|
@@ -252,7 +256,7 @@ RSpec.describe IsoDoc do
|
|
252
256
|
</bibdata>
|
253
257
|
|
254
258
|
<preface>
|
255
|
-
<p>
|
259
|
+
<p displayorder="1">
|
256
260
|
30,000
|
257
261
|
<stem type='MathML'>
|
258
262
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
@@ -369,7 +373,8 @@ RSpec.describe IsoDoc do
|
|
369
373
|
|
370
374
|
before do
|
371
375
|
allow_any_instance_of(IsoDoc::PresentationXMLConvert)
|
372
|
-
.to(receive(:twitter_cldr_localiser_symbols)
|
376
|
+
.to(receive(:twitter_cldr_localiser_symbols)
|
377
|
+
.and_return(additional_symbols))
|
373
378
|
end
|
374
379
|
|
375
380
|
it "Supports twitter_cldr_localiser_symbols fraction options" do
|
@@ -381,34 +386,53 @@ RSpec.describe IsoDoc do
|
|
381
386
|
end
|
382
387
|
|
383
388
|
it "localises numbers in MathML in French" do
|
384
|
-
|
385
|
-
|
386
|
-
|
389
|
+
input = <<~INPUT
|
390
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
391
|
+
<bibdata>
|
392
|
+
<title language="en">test</title>
|
393
|
+
<language>fr</language>
|
394
|
+
</bibdata>
|
395
|
+
<preface>
|
396
|
+
<p><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math>
|
397
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>1</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
|
398
|
+
</preface>
|
399
|
+
</iso-standard>
|
400
|
+
INPUT
|
401
|
+
output = <<~OUTPUT
|
402
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
387
403
|
<bibdata>
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
404
|
+
<title language='en'>test</title>
|
405
|
+
<language current='true'>fr</language>
|
406
|
+
</bibdata>
|
407
|
+
<preface>
|
408
|
+
<p displayorder="1">
|
409
|
+
30 000
|
410
|
+
<stem type='MathML'>
|
411
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
412
|
+
<mi>P</mi>
|
413
|
+
<mfenced open='(' close=')'>
|
414
|
+
<mrow>
|
415
|
+
<mi>X</mi>
|
416
|
+
<mo>≥</mo>
|
417
|
+
<msub>
|
418
|
+
<mrow>
|
419
|
+
<mi>X</mi>
|
420
|
+
</mrow>
|
421
|
+
<mrow>
|
422
|
+
<mo>max</mo>
|
423
|
+
</mrow>
|
424
|
+
</msub>
|
425
|
+
</mrow>
|
426
|
+
</mfenced>
|
427
|
+
<mo>=</mo>
|
428
|
+
<munderover>
|
429
|
+
<mrow>
|
430
|
+
<mo>∑</mo>
|
431
|
+
</mrow>
|
432
|
+
<mrow>
|
409
433
|
<mrow>
|
410
|
-
<mi>
|
411
|
-
<mo
|
434
|
+
<mi>j</mi>
|
435
|
+
<mo>=</mo>
|
412
436
|
<msub>
|
413
437
|
<mrow>
|
414
438
|
<mi>X</mi>
|
@@ -418,109 +442,113 @@ RSpec.describe IsoDoc do
|
|
418
442
|
</mrow>
|
419
443
|
</msub>
|
420
444
|
</mrow>
|
421
|
-
</
|
422
|
-
<
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
445
|
+
</mrow>
|
446
|
+
<mrow>
|
447
|
+
<mn>1 000</mn>
|
448
|
+
</mrow>
|
449
|
+
</munderover>
|
450
|
+
<mfenced open='(' close=')'>
|
451
|
+
<mtable>
|
452
|
+
<mtr>
|
453
|
+
<mtd>
|
454
|
+
<mn>1 000</mn>
|
455
|
+
</mtd>
|
456
|
+
</mtr>
|
457
|
+
<mtr>
|
458
|
+
<mtd>
|
429
459
|
<mi>j</mi>
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
<mfenced open='(' close=')'>
|
446
|
-
<mtable>
|
447
|
-
<mtr>
|
448
|
-
<mtd>
|
449
|
-
<mn>1 000</mn>
|
450
|
-
</mtd>
|
451
|
-
</mtr>
|
452
|
-
<mtr>
|
453
|
-
<mtd>
|
454
|
-
<mi>j</mi>
|
455
|
-
</mtd>
|
456
|
-
</mtr>
|
457
|
-
</mtable>
|
458
|
-
</mfenced>
|
459
|
-
<msup>
|
460
|
-
<mrow>
|
461
|
-
<mi>p</mi>
|
462
|
-
</mrow>
|
463
|
-
<mrow>
|
464
|
-
<mi>j</mi>
|
465
|
-
</mrow>
|
466
|
-
</msup>
|
467
|
-
<msup>
|
468
|
-
<mrow>
|
469
|
-
<mfenced open='(' close=')'>
|
470
|
-
<mrow>
|
471
|
-
<mn>1</mn>
|
472
|
-
<mo>−</mo>
|
473
|
-
<mi>p</mi>
|
474
|
-
</mrow>
|
475
|
-
</mfenced>
|
476
|
-
</mrow>
|
477
|
-
<mrow>
|
460
|
+
</mtd>
|
461
|
+
</mtr>
|
462
|
+
</mtable>
|
463
|
+
</mfenced>
|
464
|
+
<msup>
|
465
|
+
<mrow>
|
466
|
+
<mi>p</mi>
|
467
|
+
</mrow>
|
468
|
+
<mrow>
|
469
|
+
<mi>j</mi>
|
470
|
+
</mrow>
|
471
|
+
</msup>
|
472
|
+
<msup>
|
473
|
+
<mrow>
|
474
|
+
<mfenced open='(' close=')'>
|
478
475
|
<mrow>
|
479
|
-
<mn>1
|
476
|
+
<mn>1</mn>
|
480
477
|
<mo>−</mo>
|
481
|
-
<mi>
|
478
|
+
<mi>p</mi>
|
482
479
|
</mrow>
|
480
|
+
</mfenced>
|
481
|
+
</mrow>
|
482
|
+
<mrow>
|
483
|
+
<mrow>
|
484
|
+
<mn>1,003</mn>
|
485
|
+
<mo>−</mo>
|
486
|
+
<mi>j</mi>
|
483
487
|
</mrow>
|
484
|
-
</
|
485
|
-
</
|
486
|
-
</
|
487
|
-
</
|
488
|
-
</
|
489
|
-
</
|
490
|
-
|
488
|
+
</mrow>
|
489
|
+
</msup>
|
490
|
+
</math>
|
491
|
+
</stem>
|
492
|
+
</p>
|
493
|
+
</preface>
|
494
|
+
</iso-standard>
|
495
|
+
OUTPUT
|
496
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
497
|
+
.convert("test", input, true))
|
498
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
499
|
+
.to be_equivalent_to xmlpp(output)
|
491
500
|
end
|
492
501
|
|
493
502
|
it "customises localisation of numbers" do
|
494
503
|
mock_symbols
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
504
|
+
input = <<~INPUT
|
505
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
506
|
+
<bibdata>
|
507
|
+
<title language="en">test</title>
|
508
|
+
<language>fr</language>
|
509
|
+
</bibdata>
|
510
|
+
<preface>
|
511
|
+
<p><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math></stem>
|
512
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>0.0000032</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
|
513
|
+
</preface>
|
514
|
+
</iso-standard>
|
515
|
+
INPUT
|
516
|
+
output = <<~OUTPUT
|
517
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
518
|
+
<bibdata>
|
519
|
+
<title language='en'>test</title>
|
520
|
+
<language current='true'>fr</language>
|
501
521
|
</bibdata>
|
502
|
-
<preface>
|
503
|
-
<p><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mn>30000</mn></math></stem>
|
504
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>P</mi><mfenced open="(" close=")"><mrow><mi>X</mi><mo>≥</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mfenced><mo>=</mo><munderover><mrow><mo>∑</mo></mrow><mrow><mrow><mi>j</mi><mo>=</mo><msub><mrow><mi>X</mi></mrow><mrow><mo>max</mo></mrow></msub></mrow></mrow><mrow><mn>1000</mn></mrow></munderover><mfenced open="(" close=")"><mtable><mtr><mtd><mn>1000</mn></mtd></mtr><mtr><mtd><mi>j</mi></mtd></mtr></mtable></mfenced><msup><mrow><mi>p</mi></mrow><mrow><mi>j</mi></mrow></msup><msup><mrow><mfenced open="(" close=")"><mrow><mn>0.0000032</mn><mo>−</mo><mi>p</mi></mrow></mfenced></mrow><mrow><mrow><mn>1.003</mn><mo>−</mo><mi>j</mi></mrow></mrow></msup></math></stem></p>
|
505
|
-
</preface>
|
506
|
-
</iso-standard>
|
507
|
-
INPUT
|
508
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
509
|
-
<bibdata>
|
510
|
-
<title language='en'>test</title>
|
511
|
-
<language current='true'>fr</language>
|
512
|
-
</bibdata>
|
513
522
|
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
523
|
+
<preface>
|
524
|
+
<p displayorder="1">
|
525
|
+
30'000
|
526
|
+
<stem type='MathML'>
|
527
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
528
|
+
<mi>P</mi>
|
529
|
+
<mfenced open='(' close=')'>
|
530
|
+
<mrow>
|
531
|
+
<mi>X</mi>
|
532
|
+
<mo>≥</mo>
|
533
|
+
<msub>
|
534
|
+
<mrow>
|
535
|
+
<mi>X</mi>
|
536
|
+
</mrow>
|
537
|
+
<mrow>
|
538
|
+
<mo>max</mo>
|
539
|
+
</mrow>
|
540
|
+
</msub>
|
541
|
+
</mrow>
|
542
|
+
</mfenced>
|
543
|
+
<mo>=</mo>
|
544
|
+
<munderover>
|
545
|
+
<mrow>
|
546
|
+
<mo>∑</mo>
|
547
|
+
</mrow>
|
548
|
+
<mrow>
|
521
549
|
<mrow>
|
522
|
-
<mi>
|
523
|
-
<mo
|
550
|
+
<mi>j</mi>
|
551
|
+
<mo>=</mo>
|
524
552
|
<msub>
|
525
553
|
<mrow>
|
526
554
|
<mi>X</mi>
|
@@ -530,81 +558,130 @@ RSpec.describe IsoDoc do
|
|
530
558
|
</mrow>
|
531
559
|
</msub>
|
532
560
|
</mrow>
|
533
|
-
</
|
534
|
-
<
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
561
|
+
</mrow>
|
562
|
+
<mrow>
|
563
|
+
<mn>1'000</mn>
|
564
|
+
</mrow>
|
565
|
+
</munderover>
|
566
|
+
<mfenced open='(' close=')'>
|
567
|
+
<mtable>
|
568
|
+
<mtr>
|
569
|
+
<mtd>
|
570
|
+
<mn>1'000</mn>
|
571
|
+
</mtd>
|
572
|
+
</mtr>
|
573
|
+
<mtr>
|
574
|
+
<mtd>
|
541
575
|
<mi>j</mi>
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
<mfenced open='(' close=')'>
|
558
|
-
<mtable>
|
559
|
-
<mtr>
|
560
|
-
<mtd>
|
561
|
-
<mn>1'000</mn>
|
562
|
-
</mtd>
|
563
|
-
</mtr>
|
564
|
-
<mtr>
|
565
|
-
<mtd>
|
566
|
-
<mi>j</mi>
|
567
|
-
</mtd>
|
568
|
-
</mtr>
|
569
|
-
</mtable>
|
570
|
-
</mfenced>
|
571
|
-
<msup>
|
572
|
-
<mrow>
|
573
|
-
<mi>p</mi>
|
574
|
-
</mrow>
|
575
|
-
<mrow>
|
576
|
-
<mi>j</mi>
|
577
|
-
</mrow>
|
578
|
-
</msup>
|
579
|
-
<msup>
|
580
|
-
<mrow>
|
581
|
-
<mfenced open='(' close=')'>
|
582
|
-
<mrow>
|
583
|
-
<mn>0,0000032</mn>
|
584
|
-
<mo>−</mo>
|
585
|
-
<mi>p</mi>
|
586
|
-
</mrow>
|
587
|
-
</mfenced>
|
588
|
-
</mrow>
|
589
|
-
<mrow>
|
576
|
+
</mtd>
|
577
|
+
</mtr>
|
578
|
+
</mtable>
|
579
|
+
</mfenced>
|
580
|
+
<msup>
|
581
|
+
<mrow>
|
582
|
+
<mi>p</mi>
|
583
|
+
</mrow>
|
584
|
+
<mrow>
|
585
|
+
<mi>j</mi>
|
586
|
+
</mrow>
|
587
|
+
</msup>
|
588
|
+
<msup>
|
589
|
+
<mrow>
|
590
|
+
<mfenced open='(' close=')'>
|
590
591
|
<mrow>
|
591
|
-
<mn>
|
592
|
+
<mn>0,0000032</mn>
|
592
593
|
<mo>−</mo>
|
593
|
-
<mi>
|
594
|
+
<mi>p</mi>
|
594
595
|
</mrow>
|
596
|
+
</mfenced>
|
597
|
+
</mrow>
|
598
|
+
<mrow>
|
599
|
+
<mrow>
|
600
|
+
<mn>1,003</mn>
|
601
|
+
<mo>−</mo>
|
602
|
+
<mi>j</mi>
|
595
603
|
</mrow>
|
596
|
-
</
|
597
|
-
</
|
598
|
-
</
|
599
|
-
</
|
600
|
-
</
|
601
|
-
</
|
602
|
-
|
604
|
+
</mrow>
|
605
|
+
</msup>
|
606
|
+
</math>
|
607
|
+
</stem>
|
608
|
+
</p>
|
609
|
+
</preface>
|
610
|
+
</iso-standard>
|
611
|
+
OUTPUT
|
612
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
613
|
+
.convert("test", input, true))
|
614
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
615
|
+
.to be_equivalent_to xmlpp(output)
|
616
|
+
end
|
617
|
+
|
618
|
+
it "resolve address components" do
|
619
|
+
input = <<~INPUT
|
620
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
621
|
+
<bibdata>
|
622
|
+
<contributor>
|
623
|
+
<role type='author'/>
|
624
|
+
<person>
|
625
|
+
<name>
|
626
|
+
<completename>Fred Flintstone</completename>
|
627
|
+
</name>
|
628
|
+
<affiliation>
|
629
|
+
<organization>
|
630
|
+
<name>Slate Rock and Gravel Company</name>
|
631
|
+
<address>
|
632
|
+
<street>1 Infinity Loop</street>
|
633
|
+
<city>Cupertino</city>
|
634
|
+
<state>CA</state>
|
635
|
+
<country>USA</country>
|
636
|
+
<postcode>95014</postcode>
|
637
|
+
</address>
|
638
|
+
</organization>
|
639
|
+
</affiliation>
|
640
|
+
</person>
|
641
|
+
</contributor>
|
642
|
+
</bibdata>
|
643
|
+
</iso-standard>
|
644
|
+
INPUT
|
645
|
+
output = <<~OUTPUT
|
646
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
647
|
+
<bibdata>
|
648
|
+
<contributor>
|
649
|
+
<role type='author'/>
|
650
|
+
<person>
|
651
|
+
<name>
|
652
|
+
<completename>Fred Flintstone</completename>
|
653
|
+
</name>
|
654
|
+
<affiliation>
|
655
|
+
<organization>
|
656
|
+
<name>Slate Rock and Gravel Company</name>
|
657
|
+
<address>
|
658
|
+
<formattedAddress>
|
659
|
+
1 Infinity Loop
|
660
|
+
<br/>
|
661
|
+
Cupertino
|
662
|
+
<br/>
|
663
|
+
CA
|
664
|
+
<br/>
|
665
|
+
USA 95014
|
666
|
+
</formattedAddress>
|
667
|
+
</address>
|
668
|
+
</organization>
|
669
|
+
</affiliation>
|
670
|
+
</person>
|
671
|
+
</contributor>
|
672
|
+
</bibdata>
|
673
|
+
</iso-standard>
|
674
|
+
OUTPUT
|
675
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
676
|
+
.convert("test", input, true))
|
677
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
678
|
+
.to be_equivalent_to xmlpp(output)
|
603
679
|
end
|
604
680
|
|
605
681
|
private
|
606
682
|
|
607
683
|
def mock_symbols
|
608
|
-
allow_any_instance_of(::IsoDoc::PresentationXMLConvert)
|
684
|
+
allow_any_instance_of(::IsoDoc::PresentationXMLConvert)
|
685
|
+
.to receive(:twitter_cldr_localiser_symbols).and_return(group: "'")
|
609
686
|
end
|
610
687
|
end
|