Skip to content

fix(content): read German and Turkish roles as people write them, and no bare "'a göre" (#1421 follow-up) - #1443

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/people-guard-tr-de
Oct 24, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/people-guard-tr-de

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1421: the two notes left in my reply there. The people guard (CE-044) misread names in German and Turkish. Server only, in content-people.js.

German

  • Role nouns are capitalised, so they are now read in either case. "Geschäftsführerin Anna Schmidt hat das Team aufgebaut." now gets its placeholder.
  • A few common roles are added: Leiter/in, Experte/Expertin, Inhaber/in, Direktor/in, Sprecher/in.
  • "Leiter" isn't read before a name. It also means "ladder", and a title follows it ("Leiter Vertrieb Europa"). After a name it is still read: "Max Müller, Leiter Vertrieb Europa, sagte es." → [name…], Leiter Vertrieb Europa, ….

Turkish

  • Roles are read in either case (a capital at a sentence's start), with their possessive:
    • -(ı)mız is the speaker's own, so it always means a person: "kurucumuz Ali Kaya", "SEO uzmanımız Deniz Ak".
    • A bare -(s)ı may name a trade, not a person. A name after it is read only where the name ends: at punctuation, at "'a göre", or before a verb said of people. So "pazarlama müdürü Ayşe Yılmaz'a göre…" gets its placeholder, while "Bir pazarlama uzmanı Google Analytics raporlarını inceler." stays as written.
  • A title's own words aren't taken as the name: "Kurucu Ortak Ali Kaya", "Genel Müdür Yardımcısı Ali Kaya".
  • "…'a göre" alone no longer reads a name, as "according to" stopped doing in feat(content): keep the Content Agent from inventing people and quotes (CE-044) #1421: a tool goes with it too ("Google Analytics'e göre"). With a role, the name is still read.

English behaves as before. English roles before a name stay lower-case or abbreviations, so "Director Pro" is still no role.

A pre-push review agent found two false positives in my first version: a trade's -(s)ı before a tool name, and "Leiter" before a title or a product. Both are fixed and tested.

Related issue

Follow-up to #1421.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

Run cd server && npx vitest run src/lib/content-people.test.js. These cases are tested:

  • the German and Turkish role lines above;
  • the lines that must stay as written (a trade, a German ladder, "…'a göre" alone);
  • title words;
  • the heading case.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): not applicable, server only
  • yarn typecheck passes (run from web/): not applicable, server only
  • yarn format:check passes (run from web/): not applicable, server only
  • Changes are focused — one concern per PR

Server: npm run format, npm run lint and npm test pass (190 files / 2309 tests).

🤖 Generated with Claude Code

… no bare "'a göre" (ansvisor#1421 follow-up)

The Content Agent's people guard (CE-044) missed and mis-read names in
German and Turkish:

- German roles are nouns, so capitalised: "Geschäftsführerin Anna Schmidt"
  is now read; "Leiter" isn't read before a name (a ladder too, and a
  title follows it), only after one
- Turkish roles in either case, with the possessive: "-(ı)mız" is the
  speaker's own ("kurucumuz Ali Kaya"); a trade's bare "-(s)ı" ("pazarlama
  uzmanı") names a person only where the name ends (punctuation, "'a
  göre", a verb said of people), so "Bir pazarlama uzmanı Google
  Analytics…" stays
- a title's own words aren't the name's ("Kurucu Ortak", "Müdür Yardımcısı")
- "…'a göre" alone no longer reads a name, as "according to" doesn't: a
  tool goes with it too ("Google Analytics'e göre")

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One fix before merge.

  1. After a trade's "-(s)ı", a tool is still read as a person when it takes a case suffix or a comma.

    • The new cue (server/src/lib/content-people.js:225-232) ends the name at any apostrophe or any punctuation. In Turkish, a tool takes the same suffixes a person does, so each of these lines gets a placeholder:
      • "Bir pazarlama uzmanı Google Analytics'i her gün açar." becomes "Bir pazarlama uzmanı [name of a real person]'i her gün açar.";
      • "Hesap yöneticisi Google Ads'te kampanyayı açar.";
      • "Proje yöneticisi Microsoft Teams'te toplantı açar.";
      • "Bir SEO uzmanı Screaming Frog'u kullanır.";
      • "Bir SEO uzmanı Google Analytics, Search Console ve Ahrefs kullanır."
    • Main reads none of them. Unless the brief or the sources name the tool, each one becomes a to-do that holds the export.
    • Fix:
      • take the apostrophe only before "göre": ['’](?:a|e|ya|ye|na|ne)\s+göre(?!\p{L});
      • keep the end of a sentence (\s*[.!?)]), but drop ,, ; and :.
    • I tried this change:
      • every line in this PR's tests gives the same result as before;
      • the five lines above stay as written.
    • The one line it gives up is "pazarlama müdürü Ayşe Yılmaz, kampanyayı yönetti". That is the same trade-off #1421 made for "according to".
    • Add the five lines above as tests.
  2. (low) A capitalised role before a title-case name is now read as a person.

    • Turkish, at a sentence start:
      • "Uzman Destek Ekibi ile çalışın." becomes "Uzman [name of a real person] ile çalışın.";
      • "Yönetici Paneli Girişi için tıklayın.";
      • "Danışman Hizmetleri Paketi ile başlayın."
    • German, before a department or a business:
      • "Als Direktor Vertrieb Europa verantwortet sie das Team.";
      • "Die Inhaberin Café Sonnenschein öffnet um acht.";
      • "Geschäftsführer Technik Produkt ist ein neuer Posten."
    • Main reads none of them. The German lines are the same case as "Leiter", for other roles.
    • Suggestion: list the common department and feature nouns that follow a role as title words, as TITLE_WORDS_TR (:147) does, so personIn skips them. Examples: Vertrieb, Marketing, Technik, Finanzen, Destek, Panel, Hizmet. Otherwise, accept these and note it in the comment.
  3. (low) One comment gives an example the code doesn't read.

    • The comment at :223 says "uzmanı Deniz Ak anlattı." is read. But "anlattı" isn't in PERSON_SPEECH (:196), so that line stays as written.
    • Either add the verbs said only of people, "anlattı" and "dedi", or change the example.

Checked

  • Speed: the new patterns stay fast on long, adversarial input: 0.1–0.3 s for 250–600k characters, with no backtracking blow-up.
  • English: unchanged. "Director Pro" and "Our Director Pro Plan" stay as written.
  • "…'a göre" alone: it no longer reads a name, as the body says.
  • Merge state: merges cleanly on current main. Server only, no migration. CI is green.

…e", a verb said of people or a sentence's end

- a tool takes the other case suffixes and sits in lists as a person does
  ("uzmanı Google Analytics'i açar"), so neither an apostrophe nor , ; :
  ends a name there; "'ın söylediğine göre" still does
- no name is read right after a role when a department or a feature comes
  next ("Yönetici Paneli Giriş Sayfası", "Direktor Vertrieb Europa Nord")
- "dedi" and "anlattı" are speech, with a quote and after a name

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

Thanks. Both items are fixed in 07206c1.

  1. A tool after a trade's "-(s)ı". The cue now ends a name only:

    • before "'a göre" ('a, 'e, 'ya, 'ye, 'na, 'ne, with a straight or curly apostrophe);
    • before "'ın söylediğine/dediğine/belirttiğine/anlattığına göre";
    • before a verb said of people;
    • at a sentence's end (., !, ?, )).

    , ; and : no longer end a name. The five lines you listed are tests now. "pazarlama müdürü Ayşe Yılmaz, kampanyayı yönetti" is pinned as the trade-off.

  2. A capitalised role before a department or a feature.

    • A short TITLE_NOUNS list (destek, ekip, panel, hizmet…, Vertrieb, Technik, Produkt…) is skipped as a role is.
    • No name is read right after a role when one of these words comes next, so longer titles stay too ("Yönetici Paneli Giriş Sayfası", "Direktor Vertrieb Europa Nord").
    • "Direktor Vertrieb Hans Müller sagte" is still read, through the speech cue.
    • "Inhaberin Café Sonnenschein" stays as it is. German puts "des" or "vom" there, so it is rare. The comment says so.

Also: "dedi" and "anlattı" are in SPEECH too, so a quote before them is read as it is before "söyledi". One side effect: "Google Gemini dedi ki…" now reads as a person, the same as "Google Gemini said" already does in English.

Server checks: format, lint and all 2,309 tests pass.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All items done. One small optional follow-up.

  1. (low, optional) A word that ends in a speech verb counts as speech before a short quote.
    • SPOKEN_BEFORE (server/src/lib/content-people.js:357) has no word start before ${SPEECH}.
    • With "dedi" added, "Bir müşteri ödedi: “çok iyi”" now gets the quote placeholder ("ödedi" is "paid").
    • The same gap already exists on main through "dit": "Most threads on Reddit: “great tool”" gets the placeholder too.
    • Fix: (?<!\p{L}) before ${SPEECH} in SPOKEN_BEFORE. It covers both.

Checked

  • Item 1: the five tool lines stay as written. "'a göre" in each form, "'ın söylediğine göre", a verb said of people and a sentence's end still read a name. ", ; :" no longer do. The comma case is pinned as the trade-off.
  • Item 2: the six lines stay as written, except "Inhaberin Café Sonnenschein", which the comment now names as accepted.
    • "Direktor Vertrieb Hans Müller sagte" now replaces only the name. Before, it took "Vertrieb" with it.
    • "Marketing Director said" and "Satış Müdürü söyledi" are no longer read as people. Main reads both.
    • "Geschäftsführer Technik Hans Müller leitet das Team." isn't read without a verb. Main doesn't read it either, so that isn't a regression.
  • Item 3: "uzmanı Deniz Ak anlattı." is read, as the comment says.
  • Speed: 0.03–0.36 s on 300–620k characters of adversarial input, with no backtracking.

@gkhngyk
gkhngyk merged commit aea1a12 into ansvisor:main Oct 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants