require "spec_helper" RSpec.describe IsoDoc do it "processes IsoXML terms" do input = <<~INPUT Terms and definitions paddy rice

rice retaining its husk after threshing

Foreign seeds, husks, bran, sand, dust.

  • A
  • A
3.1ISO 7301:2011, 3.1

The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here

paddypaddy rice rough rice cargo rice

rice retaining its husk after threshing

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

  • A

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

  • A
3.1ISO 7301:2011, 3.1
INPUT presxml = <<~INPUT 1<tab/>Terms and definitions 1.1paddy rice

rice retaining its husk after threshing

EXAMPLE 1

Foreign seeds, husks, bran, sand, dust.

  • A
EXAMPLE 2
  • A
3.1ISO 7301:2011, 3.1

The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here

1.2 paddypaddy rice rough rice cargo rice

rice retaining its husk after threshing

Note 1 to entry

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

Note 2 to entry
  • A

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

EXAMPLE
  • A
3.1ISO 7301:2011, 3.1
INPUT html = <<~OUTPUT #{HTML_HDR}

FOREWORD

#{IEC_TITLE1}

1  Terms and definitions

1.1

paddy

<rice> rice retaining its husk after threshing

EXAMPLE 1  Foreign seeds, husks, bran, sand, dust.

  • A

EXAMPLE 2 

  • A

[TERMREF] ISO 7301:2011, 3.1 [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here [/TERMREF]

1.2

paddy

paddy rice

rough rice

DEPRECATED: cargo rice

rice retaining its husk after threshing

EXAMPLE 

  • A

Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

Note 2 to entry:

  • A

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

[TERMREF] ISO 7301:2011, 3.1 [/TERMREF]

OUTPUT word = <<~OUTPUT

1  Terms and definitions

1.1

paddy

<rice> rice retaining its husk after threshing

EXAMPLE 1  Foreign seeds, husks, bran, sand, dust.

EXAMPLE 2 

[TERMREF] ISO 7301:2011, 3.1 [MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here [/TERMREF]

1.2

paddy

paddy rice

rough rice

DEPRECATED: cargo rice

rice retaining its husk after threshing

EXAMPLE 

Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

Note 2 to entry:

The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.

[TERMREF] ISO 7301:2011, 3.1 [/TERMREF]

OUTPUT expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml) expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html) expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", presxml, true).sub(%r{^.*
}m, '
').sub(%r{
\s*]*>\s*
.*$}m, ""))).to be_equivalent_to xmlpp(word) end end