feat: author emergent situations and dialogue
This commit is contained in:
@@ -17,12 +17,27 @@ func validate() -> Array[String]:
|
||||
errors.append("display_name is empty for alternative '%s'" % alternative_id)
|
||||
if resolution_predicate_ids.is_empty():
|
||||
errors.append("alternative '%s' has no resolution predicates" % alternative_id)
|
||||
var seen_predicate_ids := {}
|
||||
for predicate_id in resolution_predicate_ids:
|
||||
if predicate_id.is_empty():
|
||||
errors.append("alternative '%s' has an empty resolution predicate ID" % alternative_id)
|
||||
elif seen_predicate_ids.has(predicate_id):
|
||||
errors.append(
|
||||
(
|
||||
"alternative '%s' has duplicate resolution predicate '%s'"
|
||||
% [alternative_id, predicate_id]
|
||||
)
|
||||
)
|
||||
seen_predicate_ids[predicate_id] = true
|
||||
var seen_topic_ids := {}
|
||||
for topic_id in dialogue_topic_ids:
|
||||
if topic_id.is_empty():
|
||||
errors.append("alternative '%s' has an empty dialogue topic ID" % alternative_id)
|
||||
elif seen_topic_ids.has(topic_id):
|
||||
errors.append(
|
||||
"alternative '%s' has duplicate dialogue topic '%s'" % [alternative_id, topic_id]
|
||||
)
|
||||
seen_topic_ids[topic_id] = true
|
||||
for term_key in commitment_terms:
|
||||
if not term_key is String and not term_key is StringName:
|
||||
errors.append("alternative '%s' has a non-string commitment term key" % alternative_id)
|
||||
|
||||
Reference in New Issue
Block a user