From a90c3fcff802cec31405f5d397e658996c4ba61b Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Thu, 9 Jan 2025 09:11:14 +0200 Subject: [PATCH] https://github.com/metanorma/isodoc/issues/630 --- lib/isodoc/presentation_function/concepts.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/isodoc/presentation_function/concepts.rb b/lib/isodoc/presentation_function/concepts.rb index f3095f3b..cc6ad509 100644 --- a/lib/isodoc/presentation_function/concepts.rb +++ b/lib/isodoc/presentation_function/concepts.rb @@ -174,8 +174,9 @@ def designation1(desgn) def designation_annotate(desgn, name, orig) designation_boldface(desgn) designation_field(desgn, name, orig) - g = desgn.at(ns("./expression/grammar")) and - name << ", #{designation_grammar(g).join(', ')}" + #g = desgn.at(ns("./expression/grammar")) and + #name << ", #{designation_grammar(g).join(', ')}" + designation_grammar(desgn, name) designation_localization(desgn, name, orig) designation_pronunciation(desgn, name) designation_bookmarks(desgn, name) @@ -195,17 +196,17 @@ def designation_field(desgn, name, orig) name << ", <#{f}>" end - def designation_grammar(grammar) + def designation_grammar(desgn, name) + g = desgn.at(ns("./expression/grammar")) or return ret = [] - grammar.xpath(ns("./gender | ./number")).each do |x| + g.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] + g.at(ns("./#{x}[text() = 'true']")) and ret << @i18n.grammar_abbrevs[x] end - ret + name << ", #{ret.join(', ')}" end def designation_localization(desgn, name, orig_desgn)