From 4be4eff4dee1b2c2a4a5deb5614331bc0e16738c Mon Sep 17 00:00:00 2001
From: Nick Nicholas
Date: Sun, 29 Dec 2024 22:43:27 +0200
Subject: [PATCH 01/18] Presentation XML refactor, terms:
https://github.com/metanorma/isodoc/issues/630
---
lib/isodoc/function/inline.rb | 1 +
lib/isodoc/function/terms.rb | 40 +-
lib/isodoc/function/to_word_html.rb | 15 +-
lib/isodoc/presentation_function/autonum.rb | 17 +-
lib/isodoc/presentation_function/concepts.rb | 146 +-
lib/isodoc/presentation_function/inline.rb | 2 +
lib/isodoc/presentation_function/terms.rb | 185 +-
lib/isodoc/presentation_xml_convert.rb | 2 +
spec/isodoc/terms_spec.rb | 2330 ++++++++++++------
9 files changed, 1786 insertions(+), 952 deletions(-)
diff --git a/lib/isodoc/function/inline.rb b/lib/isodoc/function/inline.rb
index 6d299a5f..17f868a8 100644
--- a/lib/isodoc/function/inline.rb
+++ b/lib/isodoc/function/inline.rb
@@ -203,6 +203,7 @@ def children_parse(node, out)
def xref_label_parse(node, out); end
def name_parse(node, out); end
+ def semx_definition_parse(node, out); end
def floating_title_parse(node, out); end
diff --git a/lib/isodoc/function/terms.rb b/lib/isodoc/function/terms.rb
index fbb1e352..1eb1f081 100644
--- a/lib/isodoc/function/terms.rb
+++ b/lib/isodoc/function/terms.rb
@@ -10,21 +10,42 @@ def modification_parse(node, out)
para.children.each { |n| parse(n, out) }
end
+ def semx_deprecated_term_parse(node, out); end
+
def deprecated_term_parse(node, out)
- out.p class: "DeprecatedTerms", style: "text-align:left;" do |p|
- node.children.each { |c| parse(c, p) }
+ node.children.each do |c|
+ if c.name == "p"
+ out.p class: "DeprecatedTerms", style: "text-align:left;" do |p|
+ c.children.each { |c1| parse(c1, p) }
+ end
+ else parse(c, out)
+ end
end
end
+ def semx_admitted_term_parse(node, out); end
+
def admitted_term_parse(node, out)
- out.p class: "AltTerms", style: "text-align:left;" do |p|
- node.children.each { |c| parse(c, p) }
+ node.children.each do |c|
+ if c.name == "p"
+ out.p class: "AltTerms", style: "text-align:left;" do |p|
+ c.children.each { |c1| parse(c1, p) }
+ end
+ else parse(c, out)
+ end
end
end
+ def semx_term_parse(node, out); end
+
def term_parse(node, out)
- out.p class: "Terms", style: "text-align:left;" do |p|
- node.children.each { |c| parse(c, p) }
+ node.children.each do |c|
+ if c.name == "p"
+ out.p class: "Terms", style: "text-align:left;" do |p|
+ c.children.each { |c1| parse(c1, p) }
+ end
+ else parse(c, out)
+ end
end
end
@@ -51,16 +72,15 @@ def termnote_parse1(node, para, div)
para&.name != "p" and parse(para, div)
end
+ def semx_termref_parse(node, out); end
+
def termref_parse(node, out)
out.p do |p|
node.children.each { |n| parse(n, p) }
end
end
- def termdomain_parse(node, out)
- node["hidden"] == "true" and return
- node.children.each { |n| parse(n, out) }
- end
+ def termdomain_parse(node, out); end
def termdef_parse(node, out)
name = node.at(ns("./fmt-name"))&.remove
diff --git a/lib/isodoc/function/to_word_html.rb b/lib/isodoc/function/to_word_html.rb
index c2f63d13..fe090cbb 100644
--- a/lib/isodoc/function/to_word_html.rb
+++ b/lib/isodoc/function/to_word_html.rb
@@ -215,12 +215,17 @@ def parse(node, out)
when "pre" then pre_parse(node, out)
when "annotation" then annotation_parse(node, out)
when "term" then termdef_parse(node, out)
- when "preferred" then term_parse(node, out)
- when "admitted" then admitted_term_parse(node, out)
- when "deprecates" then deprecated_term_parse(node, out)
+ when "preferred" then semx_term_parse(node, out)
+ when "fmt-preferred" then term_parse(node, out)
+ when "admitted" then semx_admitted_term_parse(node, out)
+ when "fmt-admitted" then admitted_term_parse(node, out)
+ when "deprecates" then semx_deprecated_term_parse(node, out)
+ when "fmt-deprecates" then deprecated_term_parse(node, out)
when "domain" then termdomain_parse(node, out)
- when "definition" then definition_parse(node, out)
- when "termsource" then termref_parse(node, out)
+ when "definition" then semx_definition_parse(node, out)
+ when "fmt-definition" then definition_parse(node, out)
+ when "termsource" then semx_termref_parse(node, out)
+ when "fmt-termsource" then termref_parse(node, out)
when "modification" then modification_parse(node, out)
when "termnote" then termnote_parse(node, out)
when "terms" then terms_parse(node, out)
diff --git a/lib/isodoc/presentation_function/autonum.rb b/lib/isodoc/presentation_function/autonum.rb
index afdc8032..b118fcdb 100644
--- a/lib/isodoc/presentation_function/autonum.rb
+++ b/lib/isodoc/presentation_function/autonum.rb
@@ -44,14 +44,23 @@ def transfer_id(old, new)
old.delete("id")
end
+ def semx_fmt_dup(elem)
+ elem["id"] ||= "_#{UUIDTools::UUID.random_create}"
+ new = Nokogiri::XML(<<~XML).root
+ #{to_xml(elem.children)}
+ XML
+ strip_duplicate_ids(nil, elem, new)
+ new
+ end
+
def gather_all_ids(elem)
elem.xpath(".//*[@id]").each_with_object([]) do |i, m|
m << i["id"]
end
end
- # remove ids duplicated between title and fmt-title
- # index terms are assumed transferred to fmt-title from title
+ # remove ids duplicated between sem_title and pres_title
+ # index terms are assumed transferred to pres_title from sem_title
def strip_duplicate_ids(_node, sem_title, pres_title)
sem_title && pres_title or return
ids = gather_all_ids(pres_title)
@@ -75,6 +84,10 @@ def autonum(id, num)
"#{num}"
end
+ def semx_orig(node)
+ node.parent.parent.at(".//*[@id = '#{node['source']}']")
+ end
+
def labelled_autonum(label, id, num)
elem = "#{label}"
num.blank? and return elem
diff --git a/lib/isodoc/presentation_function/concepts.rb b/lib/isodoc/presentation_function/concepts.rb
index 8d49a4ed..d6e90f98 100644
--- a/lib/isodoc/presentation_function/concepts.rb
+++ b/lib/isodoc/presentation_function/concepts.rb
@@ -71,13 +71,12 @@ def concept1_ref_content(ref)
end
def related(docxml)
- docxml.xpath(ns("//related")).each { |f| related1(f) }
+ docxml.xpath(ns("//fmt-related/semx")).each { |f| related1(f) }
end
def related1(node)
- p = node.at(ns("./preferred"))
- ref = node.at(ns("./xref | ./eref | ./termref"))
- label = @i18n.relatedterms[node["type"]].upcase
+ p, ref, orig = related1_prep(node)
+ label = @i18n.relatedterms[orig["type"]].upcase
if p && ref
node.replace(l10n("#{label}: " \
"#{to_xml(p)} (#{Common::to_xml(ref)})
"))
@@ -86,5 +85,144 @@ def related1(node)
"**RELATED TERM NOT FOUND**
"))
end
end
+
+ def related1_prep(node)
+ p = node.at(ns("./fmt-preferred"))
+ ref = node.at(ns("./xref | ./eref | ./termref"))
+ orig = semx_orig(node)
+ [p, ref, orig]
+ end
+
+ def related_designation1(desgn)
+ out = desgn.parent.at(ns("./fmt-#{desgn.name}"))
+ d1 = semx_fmt_dup(desgn)
+ %w(preferred admitted deprecates).each do |w|
+ d = d1.at(ns("./#{w}[last()]")) and d.after("")
+ end
+ out << d1
+ end
+
+ def designation(docxml)
+ docxml.xpath(ns("//related")).each { |p| related_designation1(p) }
+ docxml.xpath(ns("//preferred | //admitted | //deprecates"))
+ .each { |p| designation1(p) }
+ docxml.xpath(ns("//fmt-preferred | //fmt-admitted | //fmt-deprecates"))
+ .each { |t| merge_second_preferred(t) }
+ docxml.xpath(ns("//fmt-deprecates")).each { |d| deprecates(d) }
+ docxml.xpath(ns("//fmt-admitted")).each { |d| admits(d) }
+ end
+
+ def deprecates(elem)
+ ins = elem.at(ns("./p")) || elem
+ ins.add_first_child @i18n.l10n("#{@i18n.deprecated}: ")
+ end
+
+ def admits(elem); end
+
+ def merge_second_preferred(term)
+ pref = nil
+ out = term.xpath(ns("./semx")).each_with_index
+ .with_object([]) do |(p, i), m|
+ if (i.zero? && (pref = p)) || merge_preferred_eligible?(pref, p)
+ m << p
+ else
+ p.wrap("")
+ end
+ end
+ pref&.replace(merge_second_preferred1(out, term))
+ end
+
+ def merge_second_preferred1(desgns, term)
+ desgns[1..].each(&:remove)
+ ret = l10n(desgns.map { |x| to_xml(x) }.join("; "))
+ term.ancestors("fmt-related").empty? and ret = "#{ret}
"
+ ret
+ end
+
+ def merge_preferred_eligible?(first, second)
+ orig_first, orig_second, firstex, secondex =
+ merge_preferred_eligible_prep(first, second)
+ orig_first["geographic-area"] == orig_second["geographic-area"] &&
+ firstex["language"] == secondex["language"] &&
+ !orig_first.at(ns("./pronunciation | ./grammar | ./graphical-symbol")) &&
+ !orig_second.at(ns("./pronunciation | ./grammar | ./graphical-symbol")) &&
+ orig_first.name == "preferred" && orig_second.name == "preferred"
+ end
+
+ def merge_preferred_eligible_prep(first, second)
+ orig_first = semx_orig(first)
+ orig_second = semx_orig(second)
+ firstex = orig_first.at(ns("./expression")) || {}
+ secondex = orig_second.at(ns("./expression")) || {}
+ [orig_first, orig_second, firstex, secondex]
+ end
+
+ def designation1(desgn)
+ desgn.parent.name == "related" and return
+ out = desgn.parent.at(ns("./fmt-#{desgn.name}"))
+ d1 = semx_fmt_dup(desgn)
+ s = d1.at(ns("./termsource"))
+ name = d1.at(ns("./expression/name | ./letter-symbol/name | " \
+ "./graphical-symbol")) or return
+ designation_annotate(d1, name, desgn)
+ out << d1
+ s and out.next = s.wrap("")
+ end
+
+ def designation_annotate(desgn, name, orig)
+ designation_boldface(desgn)
+ designation_field(desgn, name)
+ g = desgn.at(ns("./expression/grammar")) and
+ name << ", #{designation_grammar(g).join(', ')}"
+ designation_localization(desgn, name, orig)
+ designation_pronunciation(desgn, name)
+ designation_bookmarks(desgn, name)
+ desgn.children = name.children
+ end
+
+ def designation_boldface(desgn)
+ desgn["element"] == "preferred" or return
+ name = desgn.at(ns("./expression/name | ./letter-symbol/name")) or return
+ name.children = "#{name.children}"
+ end
+
+ def designation_field(desgn, name)
+ f = desgn.xpath(ns("./field-of-application | ./usage-info"))
+ &.map { |u| to_xml(u.children) }&.join(", ")
+ f&.empty? and return nil
+ name << ", <#{f}>"
+ end
+
+ def designation_grammar(grammar)
+ ret = []
+ grammar.xpath(ns("./gender | ./number")).each do |x|
+ ret << @i18n.grammar_abbrevs[x.text]
+ end
+ %w(isPreposition isParticiple isAdjective isVerb isAdverb isNoun)
+ .each do |x|
+ grammar.at(ns("./#{x}[text() = 'true']")) and
+ ret << @i18n.grammar_abbrevs[x]
+ end
+ ret
+ end
+
+ def designation_localization(desgn, name, orig_desgn)
+ loc = [desgn.at(ns("./expression/@language"))&.text,
+ desgn.at(ns("./expression/@script"))&.text,
+ orig_desgn.at("./@geographic-area")&.text].compact
+ loc.empty? and return
+ name << ", #{loc.join(' ')}"
+ end
+
+ def designation_pronunciation(desgn, name)
+ f = desgn.at(ns("./expression/pronunciation")) or return
+ name << ", /#{to_xml(f.children)}/"
+ end
+
+ def designation_bookmarks(desgn, name)
+ desgn.xpath(ns(".//bookmark")).each do |b|
+ name << b.remove
+ end
+ end
end
end
diff --git a/lib/isodoc/presentation_function/inline.rb b/lib/isodoc/presentation_function/inline.rb
index 022fa39d..36f64508 100644
--- a/lib/isodoc/presentation_function/inline.rb
+++ b/lib/isodoc/presentation_function/inline.rb
@@ -61,6 +61,8 @@ def quotesource(docxml)
end
def xref1(node)
+ # Semantic XML
+ node.ancestors("related, definition, termsource").empty? or return
get_linkend(node)
end
diff --git a/lib/isodoc/presentation_function/terms.rb b/lib/isodoc/presentation_function/terms.rb
index 1a439962..91d7a01b 100644
--- a/lib/isodoc/presentation_function/terms.rb
+++ b/lib/isodoc/presentation_function/terms.rb
@@ -1,103 +1,25 @@
module IsoDoc
class PresentationXMLConvert < ::IsoDoc::Convert
- def designation(docxml)
- docxml.xpath(ns("//term")).each { |t| merge_second_preferred(t) }
- docxml.xpath(ns("//preferred | //admitted | //deprecates"))
- .each { |p| designation1(p) }
- docxml.xpath(ns("//deprecates")).each { |d| deprecates(d) }
- docxml.xpath(ns("//admitted")).each { |d| admits(d) }
- end
-
- def deprecates(elem)
- elem.add_first_child @i18n.l10n("#{@i18n.deprecated}: ")
- end
-
- def admits(elem); end
-
- def merge_second_preferred(term)
- pref = nil
- term.xpath(ns("./preferred[expression/name]")).each_with_index do |p, i|
- (i.zero? and pref = p) or merge_second_preferred1(pref, p)
- end
- end
-
- def merge_second_preferred1(pref, second)
- merge_preferred_eligible?(pref, second) or return
- n1 = pref.at(ns("./expression/name"))
- n2 = second.remove.at(ns("./expression/name"))
- n1.children = l10n("#{to_xml(n1.children)}; #{Common::to_xml(n2.children)}")
- end
-
- def merge_preferred_eligible?(first, second)
- firstex = first.at(ns("./expression")) || {}
- secondex = second.at(ns("./expression")) || {}
- first["geographic-area"] == second["geographic-area"] &&
- firstex["language"] == secondex["language"] &&
- !first.at(ns("./pronunciation | ./grammar")) &&
- !second.at(ns("./pronunciation | ./grammar"))
- end
-
- def designation1(desgn)
- s = desgn.at(ns("./termsource"))
- name = desgn.at(ns("./expression/name | ./letter-symbol/name | " \
- "./graphical-symbol")) or return
- designation_annotate(desgn, name)
- s and desgn.next = s
- end
-
- def designation_annotate(desgn, name)
- designation_boldface(desgn)
- designation_field(desgn, name)
- g = desgn.at(ns("./expression/grammar")) and
- name << ", #{designation_grammar(g).join(', ')}"
- designation_localization(desgn, name)
- designation_pronunciation(desgn, name)
- designation_bookmarks(desgn, name)
- desgn.children = name.children
- end
-
- def designation_boldface(desgn)
- desgn.name == "preferred" or return
- name = desgn.at(ns("./expression/name | ./letter-symbol/name")) or return
- name.children = "#{name.children}"
- end
-
- def designation_field(desgn, name)
- f = desgn.xpath(ns("./field-of-application | ./usage-info"))
- &.map { |u| to_xml(u.children) }&.join(", ")
- f&.empty? and return nil
- name << ", <#{f}>"
- end
-
- def designation_grammar(grammar)
- ret = []
- grammar.xpath(ns("./gender | ./number")).each do |x|
- ret << @i18n.grammar_abbrevs[x.text]
+ def termcontainers(docxml)
+ docxml.xpath(ns("//term")).each do |t|
+ %w(preferred admitted deprecates related definition termsource)
+ .each do |w|
+ d = t.at(ns("./#{w}[last()]")) and d.after("")
+ end
end
- %w(isPreposition isParticiple isAdjective isVerb isAdverb isNoun)
- .each do |x|
- grammar.at(ns("./#{x}[text() = 'true']")) and
- ret << @i18n.grammar_abbrevs[x]
+ docxml.xpath(ns("//termsource")).each do |s|
+ s["id"] ||= "_#{UUIDTools::UUID.random_create}"
end
- ret
- end
-
- def designation_localization(desgn, name)
- loc = [desgn&.at(ns("./expression/@language"))&.text,
- desgn&.at(ns("./expression/@script"))&.text,
- desgn&.at(ns("./@geographic-area"))&.text].compact
- loc.empty? and return
- name << ", #{loc.join(' ')}"
end
- def designation_pronunciation(desgn, name)
- f = desgn.at(ns("./expression/pronunciation")) or return
- name << ", /#{to_xml(f.children)}/"
- end
-
- def designation_bookmarks(desgn, name)
- desgn.xpath(ns(".//bookmark")).each do |b|
- name << b.remove
+ def termcleanup(docxml)
+ docxml.xpath(ns("//term")).each do |t|
+ %w(preferred admitted deprecates related definition termsource)
+ .each do |w|
+ t.xpath(ns("./#{w}//fmt-name | ./#{w}//fmt-xref-label")).each(&:remove)
+ f = t.at(ns("./fmt-#{w}"))
+ f&.children&.empty? and f.remove
+ end
end
end
@@ -123,29 +45,32 @@ def termnote_label(elem)
end
def termdefinition(docxml)
- docxml.xpath(ns("//term[definition]")).each do |f|
- termdefinition1(f)
- end
+ docxml.xpath(ns("//term[definition]")).each { |f| termdefinition1(f) }
end
def termdefinition1(elem)
- unwrap_definition(elem)
- multidef(elem) if elem.xpath(ns("./definition")).size > 1
- termdomain(elem)
+ d = elem.xpath(ns("./definition"))
+ d1 = elem.at(ns("./fmt-definition"))
+ if d.size > 1 then multidef(elem, d, d1)
+ else singledef(elem, d, d1)
+ end
+ unwrap_definition(elem, d1)
+ termdomain(elem, d1)
end
- def multidef(elem)
- d = elem.at(ns("./definition"))
- d = d.replace("- #{to_xml(d.children)}
").first
- elem.xpath(ns("./definition")).each do |f|
- f = f.replace("#{to_xml(f.children)}").first
- d << f
+ def multidef(_elem, defn, fmt_defn)
+ ret = defn.each_with_object([]) do |f, m|
+ m << "#{to_xml(semx_fmt_dup(f))}"
end
- d.wrap("")
+ fmt_defn << "#{ret.join("\n")}
"
+ end
+
+ def singledef(_elem, defn, fmt_defn)
+ fmt_defn << semx_fmt_dup(defn.first)
end
- def unwrap_definition(elem)
- elem.xpath(ns("./definition")).each do |d|
+ def unwrap_definition(_elem, fmt_defn)
+ fmt_defn.xpath(ns(".//semx[@element = 'definition']")).each do |d|
%w(verbal-definition non-verbal-representation).each do |e|
v = d&.at(ns("./#{e}"))
v&.replace(v.children)
@@ -153,26 +78,47 @@ def unwrap_definition(elem)
end
end
- def termdomain(elem)
+ def termdomain(elem, fmt_defn)
d = elem.at(ns(".//domain")) or return
- p = elem.at(ns(".//definition//p")) or return
- p.add_first_child "<#{d.to_xml}> "
- d["hidden"] = true
+ p = fmt_defn.at(ns(".//p")) or return
+ d1 = semx_fmt_dup(d)
+ p.add_first_child "<#{to_xml(d1)}> "
end
def termsource(docxml)
- docxml.xpath(ns("//termsource")).each { |f| termsource_modification(f) }
- docxml.xpath(ns("//termsource")).each { |f| termsource1(f) }
+ copy_baselevel_termsource(docxml)
+ # TODO should I wrap fmt-definition//termsource in fmt-termsource, in order to preserve termsource attributes?
+ docxml.xpath(ns("//fmt-termsource/termsource | //fmt-definition//termsource"))
+ .each do |f|
+ termsource_modification(f)
+ end
+ docxml.xpath(ns("//fmt-termsource/termsource | //fmt-definition//termsource"))
+ .each do |f|
+ f.parent and termsource1(f)
+ end
+ end
+
+ def copy_baselevel_termsource(docxml)
+ docxml.xpath(ns("//term[termsource]")).each do |x|
+ s = x.xpath(ns("./termsource"))
+ s1 = x.at(ns("./fmt-termsource"))
+ s.each { |ss| s1 << ss.clone }
+ strip_duplicate_ids(nil, s, s1)
+ %w(status type).each { |a| s[0][a] and s1[a] = s[0][a] }
+ end
end
def termsource1(elem)
+ ret = [semx_fmt_dup(elem)]
while elem&.next_element&.name == "termsource"
- elem << "; #{to_xml(elem.next_element.remove.children)}"
+ ret << semx_fmt_dup(elem.next_element.remove)
end
- elem.children = l10n("[#{@i18n.source}: #{to_xml(elem.children).strip}]")
+ s = ret.map { |x| to_xml(x) }.map(&:strip).join("; ")
+ elem.replace(l10n("[#{@i18n.source}: #{s}]"))
end
def termsource_modification(elem)
+ elem.xpath(".//text()[normalize-space() = '']").each(&:remove)
origin = elem.at(ns("./origin"))
s = termsource_status(elem["status"]) and origin.next = l10n(", #{s}")
termsource_add_modification_text(elem.at(ns("./modification")))
@@ -181,9 +127,8 @@ def termsource_modification(elem)
def termsource_add_modification_text(mod)
mod or return
mod.text.strip.empty? or mod.previous = " — "
- mod.elements.size == 1 and
- mod.elements[0].replace(mod.elements[0].children)
- mod.replace(mod.children)
+ mod.elements.size == 1 and mod.children = to_xml(mod.elements[0].children)
+ mod.replace(to_xml(mod.children))
end
def termsource_status(status)
diff --git a/lib/isodoc/presentation_xml_convert.rb b/lib/isodoc/presentation_xml_convert.rb
index 571ebfcb..af9a36c3 100644
--- a/lib/isodoc/presentation_xml_convert.rb
+++ b/lib/isodoc/presentation_xml_convert.rb
@@ -108,6 +108,7 @@ def inline(docxml)
end
def terms(docxml)
+ termcontainers docxml
termexample docxml
termnote docxml
termdefinition docxml
@@ -115,6 +116,7 @@ def terms(docxml)
termsource docxml
concept docxml
related docxml
+ termcleanup docxml
end
def semantic_xml_insert(xml)
diff --git a/spec/isodoc/terms_spec.rb b/spec/isodoc/terms_spec.rb
index 6ee78810..a0047e5e 100644
--- a/spec/isodoc/terms_spec.rb
+++ b/spec/isodoc/terms_spec.rb
@@ -15,24 +15,24 @@
INPUT
presxml = <<~OUTPUT
-
-
-
- Table of contents
-
-
-
+
+
+
+ Table of contents
+
+
+
Terms, Definitions, Symbols and Abbreviated Terms
1
.
-
-
-
-
- Terms, Definitions, Symbols and Abbreviated Terms
+
+
+
+
+ Terms, Definitions, Symbols and Abbreviated Terms
Clause
@@ -50,12 +50,21 @@
Clause
1
- .
- 1
+ .
+ 1
-
- Term2
+
+
+ Term2
+
+
+
+
+ Term2
+
+
+
@@ -158,305 +167,438 @@
presxml = <<~PRESXML
-
-
- Table of contents
-
-
-
-
- Terms and Definitions
-
-
- 1
- .
-
-
-
-
- Terms and Definitions
-
-
- Clause
- 1
-
- For the purposes of this document, the following terms and definitions apply.
-
-
-
- 1
- .
- 1
- .
-
-
-
- Clause
- 1
- .
- 1
-
-
- paddy
- , <in agriculture, dated>
-
-
- [SOURCE:
-
-
- 3.1
-
- ISO 7301:2011, Clause 3.1
-
- , modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
-
- rice
-
-
- <
- rice
- > rice retaining its husk after threshing
-
-
-
-
-
- EXAMPLE
- 1
-
-
-
- Example
- 1
-
-
-
- Clause
- 1
- .
- 1
-
- ,
- Example
- 1
-
- Foreign seeds, husks, bran, sand, dust.
-
-
-
-
-
- EXAMPLE
- 2
-
-
-
- Example
- 2
-
-
-
- Clause
- 1
- .
- 1
-
- ,
- Example
- 2
-
-
-
-
- [SOURCE:
-
- t1
-
- — comment ;
-
-
-
- , modified — with adjustments]
-
-
-
-
-
- 1
- .
- 2
- .
-
-
-
- Clause
- 1
- .
- 2
-
-
- paddy
-
- paddy rice, <in agriculture>
- rough rice
- DEPRECATED: cargo rice
-
- rice retaining its husk after threshing
-
-
-
-
- EXAMPLE
-
-
-
- Example
-
-
-
- Clause
- 1
- .
- 2
-
- ,
- Example
-
-
-
-
-
-
- Note
- 1
- to entry
-
- :
-
-
- Note
- 1
-
-
-
- Clause
- 1
- .
- 2
-
- ,
- Note
- 1
-
- The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.
-
-
-
-
- Note
- 2
- to entry
-
- :
-
-
- Note
- 2
-
-
-
- Clause
- 1
- .
- 2
-
- ,
- Note
- 2
-
-
- The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.
-
-
- [SOURCE:
-
-
- 3.1
-
- ISO 7301:2011, 3.1
-
-
-
- 3.1
-
- ISO 7301:2011, clause 3.1
-
- ]
-
-
-
-
-
+
+
+ Table of contents
+
+
+
+
+ Terms and Definitions
+
+
+ 1
+ .
+
+
+
+
+ Terms and Definitions
+
+
+ Clause
+ 1
+
+ For the purposes of this document, the following terms and definitions apply.
+
+
+
+ 1
+ .
+ 1
+ .
+
+
+
+ Clause
+ 1
+ .
+ 1
+
+
+
+ paddy
+
+ in agriculture
+ dated
+
+
+
+ 3.1
+
+
+
+ The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
+
+
+
+
+
+
+ paddy
+ , <in agriculture, dated>
+
+
+
+
+
+
+ 3.1
+
+
+
+ The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
+
+
+ rice
+
+
+ rice retaining its husk after threshing
+
+
+
+
+
+ <
+ rice
+ > rice retaining its husk after threshing
+
+
+
+
+
+
+ EXAMPLE
+ 1
+
+
+
+ Example
+ 1
+
+
+
+ Clause
+ 1
+ .
+ 1
+
+ ,
+ Example
+ 1
+
+ Foreign seeds, husks, bran, sand, dust.
+
+
+
+
+
+ EXAMPLE
+ 2
+
+
+
+ Example
+ 2
+
+
+
+ Clause
+ 1
+ .
+ 1
+
+ ,
+ Example
+ 2
+
+
+
+
+
+ t1
+
+
+ comment
+
+
+
+
+
+
+
+ with adjustments
+
+
+
+ [SOURCE:
+
+
+
+ 3.1
+
+ ISO 7301:2011, Clause 3.1
+
+ , modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
+
+ ;
+
+
+ t1
+
+ — comment
+
+ ;
+
+
+
+
+ , modified — with adjustments
+
+ ]
+
+
+
+
+
+ 1
+ .
+ 2
+ .
+
+
+
+ Clause
+ 1
+ .
+ 2
+
+
+
+ paddy
+
+
+
+
+
+ paddy
+
+
+
+
+
+ paddy rice
+
+ in agriculture
+
+
+
+ rough rice
+
+
+
+
+ paddy rice, <in agriculture>
+
+
+ rough rice
+
+
+
+
+ cargo rice
+
+
+
+
+ DEPRECATED:
+ cargo rice
+
+
+
+
+ rice retaining its husk after threshing
+
+
+
+
+ rice retaining its husk after threshing
+
+
+
+
+
+ EXAMPLE
+
+
+
+ Example
+
+
+
+ Clause
+ 1
+ .
+ 2
+
+ ,
+ Example
+
+
+
+
+
+
+ Note
+ 1
+ to entry
+
+ :
+
+
+ Note
+ 1
+
+
+
+ Clause
+ 1
+ .
+ 2
+
+ ,
+ Note
+ 1
+
+ The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.
+
+
+
+
+ Note
+ 2
+ to entry
+
+ :
+
+
+ Note
+ 2
+
+
+
+ Clause
+ 1
+ .
+ 2
+
+ ,
+ Note
+ 2
+
+
+ The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.
+
+
+
+
+ 3.1
+
+
+
+
+ 3.1
+
+
+
+
+ [SOURCE:
+
+
+
+ 3.1
+
+ ISO 7301:2011, 3.1
+
+
+
+ 3.1
+
+ ISO 7301:2011, clause 3.1
+
+
+ ]
+
+
+
+
+
PRESXML
html = <<~"OUTPUT"
#{HTML_HDR}
- 1. Terms and Definitions
For the purposes of this document, the following terms and definitions apply.
1.1.
paddy, <in agriculture, dated>
[SOURCE: ISO 7301:2011, Clause 3.1, modified
- —
- The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
-
-
<rice> rice retaining its husk after threshing
-
EXAMPLE 1
-
Foreign seeds, husks, bran, sand, dust.
-
-
-
-
[SOURCE: t1
- —
- comment
-
- ;
- Termbase IEV, term ID xyz, modified
- —
- with adjustments]
-
1.2.
paddy
-
paddy rice, <in agriculture>
-
rough rice
-
DEPRECATED: 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:
-
-
The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.
-
[SOURCE: ISO 7301:2011, 3.1
- ISO 7301:2011, clause 3.1]
-
-