stepmod-utils 0.3.21 → 0.3.22
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/lib/stepmod/utils/terms_extractor.rb +21 -30
- data/lib/stepmod/utils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc9977f6a7248164968637abc31b264b928a1b6de459e62a25fc9a95a250ec10
|
|
4
|
+
data.tar.gz: 030aa9b15094edaa59fbde8ff7948ff7d05dc96b73130495cedcb5f3e52c3b4d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dca1f9e90a28a17c3cbc6082fb115a705bafe55871256bd2f9112fbd4879c02335a04767d60e3d6e5aaa3a935bf738b9a003542741587b8b4537c8328fe8c17c
|
|
7
|
+
data.tar.gz: 625b2542ab86f94f54829e750d8297307dfc47dadf740c3d96d65cff611478d04d1d267eb6b3e71abffebad876bbdfd982f50e09e2081ff1feb505fdd3f20f97
|
|
@@ -476,44 +476,35 @@ module Stepmod
|
|
|
476
476
|
entity_id.downcase.gsub(/_/, " ")
|
|
477
477
|
end
|
|
478
478
|
|
|
479
|
+
def entity_ref(entity_id)
|
|
480
|
+
if entity_id == entity_name_to_text(entity_id)
|
|
481
|
+
"{{#{entity_id}}}"
|
|
482
|
+
else
|
|
483
|
+
"{{#{entity_id},#{entity_name_to_text(entity_id)}}}"
|
|
484
|
+
end
|
|
485
|
+
end
|
|
486
|
+
|
|
479
487
|
# rubocop:disable Layout/LineLength
|
|
480
488
|
def generate_entity_definition(entity, domain, old_definition)
|
|
481
489
|
return "" if entity.nil?
|
|
482
490
|
|
|
483
491
|
# See: metanorma/iso-10303-2#90
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
entity_ref = if entity.id == entity_name_to_text(entity.id)
|
|
488
|
-
"{{#{entity.id}}}"
|
|
489
|
-
else
|
|
490
|
-
"{{#{entity.id},#{entity_name_to_text(entity.id)}}}"
|
|
491
|
-
end
|
|
492
|
-
|
|
493
|
-
if entity.subtype_of.size.zero?
|
|
494
|
-
"#{domain_type[1]} that represents the " + entity_ref + " entity"
|
|
495
|
-
else
|
|
496
|
-
entity_subtypes = entity.subtype_of.map do |e|
|
|
497
|
-
"{{#{e.id},#{entity_name_to_text(e.id)}}}"
|
|
498
|
-
end
|
|
499
|
-
"#{domain_type[1]} that is a type of " +
|
|
500
|
-
"#{entity_subtypes.join(' and ')} that represents the " +
|
|
501
|
-
entity_ref + " entity"
|
|
502
|
-
end
|
|
503
|
-
|
|
492
|
+
entity_type = if domain_type = domain.match(/\A(application object):/)
|
|
493
|
+
domain_type[1]
|
|
504
494
|
else
|
|
495
|
+
"entity data type"
|
|
496
|
+
end
|
|
505
497
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
end
|
|
513
|
-
"entity data type that is a type of " +
|
|
514
|
-
"#{entity_subtypes.join(' and ')} that represents the " +
|
|
515
|
-
"{{#{entity.id}}} entity"
|
|
498
|
+
entity_text = if entity.subtype_of.size.zero?
|
|
499
|
+
"#{entity_type} " +
|
|
500
|
+
"that represents the " + entity_ref(entity.id) + " entity"
|
|
501
|
+
else
|
|
502
|
+
entity_subtypes = entity.subtype_of.map do |e|
|
|
503
|
+
"{{#{e.id}}}"
|
|
516
504
|
end
|
|
505
|
+
"#{entity_type} that is a type of " +
|
|
506
|
+
"#{entity_subtypes.join(' and ')} " +
|
|
507
|
+
"that represents the " + entity_ref(entity.id) + " entity"
|
|
517
508
|
end
|
|
518
509
|
|
|
519
510
|
definition = <<~DEFINITION
|