Add French pattern support, gated so English scoring is unchanged - #1
Open
GoldenSis wants to merge 1 commit into
Open
Add French pattern support, gated so English scoring is unchanged#1GoldenSis wants to merge 1 commit into
GoldenSis wants to merge 1 commit into
Conversation
The English rules do not reach French. A French paragraph carrying every
documented tell scores 1/100 "clean" on the current set, because French
machine prose is not English machine prose with French words.
Two families have no English original to translate from:
the calque vocabulary rendered so literally it is rare or wrong in
native French ("une riche tapisserie", "sans couture")
the faux-ami the word that looks right to an English-trained model and
means something else ("définitivement" is "permanently",
not "definitely")
Nine rules cover them, in references/patterns-fr.md with a worked Before
and After each. They are appended to the simple list only when is_french()
says the document reads as French, so a document that is not French takes
exactly the path it took before. Verified byte-identical on this
repository's own English documents.
The keys carry no catalogue number. The numbered series and its published
totals are claims about the English catalogue, and renumbering it from a
French addition would rewrite those figures everywhere they are quoted.
Measured per CONTRIBUTING: zero hits for every rule across 59,733 words of
human French. That corpus is narrow and its limits are stated in the
catalogue; fr_signposting and fr_cta are the two most likely to need
demotion to _SCORE_REPORT_ONLY against a broader one.
tests/test_french.py adds 12 checks, including that every Before trips its
own rule, every After is clean, and no French rule ever fires on English.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The miss
CONTRIBUTING.mdasks first for machine writing the detector misses. Here is one, reproducible:python scripts/detect.pyscores that 1/100,clean. The same paragraph written in Englishscores 69,
heavy tells. Every tell in it is documented in the English catalogue — the wordsare simply French.
Why a translation of the catalogue would not have fixed it
French machine prose is not English machine prose with French words. Two families carry most of the
signal and have no English original to translate from:
« une riche tapisserie », « sans couture », « un témoignage de ». A French writer does not
reach for these; a model translating from English does.
« définitivement » is the cleanest case: it means permanently, not definitely, so
« c'est définitivement le meilleur » is a translation error rather than emphasis. Same for
adresser un problème (→ traiter), supporter (→ soutenir), délivrer de la valeur (→ fournir).
What this adds
Nine rules in
references/patterns-fr.md, each with a worked Before and After, plusis_french()in
scripts/detect.py.English behaviour is unchanged, and that is the design, not a hope. The French rules are appended
to
simpleonly whenis_french()says the document reads as French; otherwise the code takesexactly the path it took before. Verified byte-identical output on this repository's own English
documents, and your 97 tests and 53 hook checks pass untouched.
The keys carry no catalogue number. The numbered series and its published totals — 71 patterns,
62 with a detector, 50 scoring — are claims about the English catalogue, quoted in README, SKILL,
ETHICS, plugin.json and marketplace.json. Renumbering from a French addition would rewrite all of
them, so these sit in their own namespace until you decide whether French belongs in the headline
count.
test_machine_checked_count_is_honesttherefore still asserts 62, unedited.Measurement
Per
CONTRIBUTING.md, a scored pattern may not fire more on human writing than on machine writing.Measured across 59,733 words of human French — spoken-word transcripts and warm, colloquial
business correspondence:
The limits of that, stated plainly. The corpus is narrow: dominated by one author's speech and
one team's correspondence, both informal, with no formal administrative French, no journalism and no
academic prose — exactly the registers where « il convient de souligner » and « n'hésitez pas à »
legitimately appear.
fr_signpostingandfr_ctaare the two most likely to need demotion to_SCORE_REPORT_ONLYagainst a broader corpus. The machine-French side was author-constructedrather than sampled, since no French AI corpus was available. Your private harness is the right
instrument for both; this arrives with its own measurement as CONTRIBUTING asks, not with a claim to
have replaced it.
Tests
tests/test_french.py, 12 checks:« Cordialement », « bon week-end » and « j'espère que vous allez bien » are deliberately
never matched
test_catalogue.pyTest-count references in README, CONTRIBUTING and CHANGELOG are updated so
check_docs.pystayshonest; that is the only reason those files are touched.
Happy to change the shape
If you would rather have French as a separate module, behind a flag, folded into the numbered
catalogue, or not at all, say which and I will rework or close this. The measurement above stands on
its own either way, and the miss it documents is real whatever happens to this branch.