Clean built-in couple formatter prose

This commit is contained in:
2026-06-27 17:14:03 +02:00
parent ed67c9ba7b
commit 0c62df36de
3 changed files with 88 additions and 5 deletions
+14 -2
View File
@@ -54,6 +54,19 @@ def _couple_clothing_phrase(item: str, clean: Callable[[Any], str]) -> str:
return f"The couple wears {item}"
def _cap_first(text: str) -> str:
text = str(text or "").strip()
return f"{text[:1].upper()}{text[1:]}" if text else ""
def _couple_subject_phrase(subject: str, ages: str) -> str:
subject = _cap_first(subject or "adult couple")
ages = str(ages or "").strip()
if ages:
return f"{subject}, {ages}"
return subject
def format_normal_row_result(
request: KreaNormalRowRequest,
deps: KreaNormalRowDependencies,
@@ -98,8 +111,7 @@ def format_normal_row_result(
ages = deps.age_detail_phrase(deps.row_value(row, "age", ("Ages",)) or row.get("age_band"))
body = deps.row_value(row, "body", ("Body types",)) or deps.clean(row.get("body_type"))
parts = [
f"An adult couple: {subject}, all visibly adult",
f"Age detail: {ages}" if ages else "",
_couple_subject_phrase(subject, ages),
f"Body types: {body}" if body else "",
_couple_clothing_phrase(item, deps.clean) if item else "",
f"The pose is {pose}" if pose else "",