Repository navigation
fix(content): read German and Turkish roles as people write them, and no bare "'a göre" (#1421 follow-up) - #1443
Conversation
… 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
left a comment
There was a problem hiding this comment.
One fix before merge.
-
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:.
- take the apostrophe only before "göre":
- 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.
- The new cue (
-
(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, sopersonInskips them. Examples: Vertrieb, Marketing, Technik, Finanzen, Destek, Panel, Hizmet. Otherwise, accept these and note it in the comment.
- Turkish, at a sentence start:
-
(low) One comment gives an example the code doesn't read.
- The comment at
:223says "uzmanı Deniz Ak anlattı." is read. But "anlattı" isn't inPERSON_SPEECH(:196), so that line stays as written. - Either add the verbs said only of people, "anlattı" and "dedi", or change the example.
- The comment at
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]>
|
Thanks. Both items are fixed in 07206c1.
Also: "dedi" and "anlattı" are in Server checks: format, lint and all 2,309 tests pass. |
gkhngyk
left a comment
There was a problem hiding this comment.
All items done. One small optional follow-up.
- (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}inSPOKEN_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.
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
[name…], Leiter Vertrieb Europa, ….Turkish
-(ı)mızis the speaker's own, so it always means a person: "kurucumuz Ali Kaya", "SEO uzmanımız Deniz Ak".-(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.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 featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Run
cd server && npx vitest run src/lib/content-people.test.js. These cases are tested:Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): not applicable, server onlyyarn typecheckpasses (run fromweb/): not applicable, server onlyyarn format:checkpasses (run fromweb/): not applicable, server onlyServer:
npm run format,npm run lintandnpm testpass (190 files / 2309 tests).🤖 Generated with Claude Code