[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find ONE feature... #86
2 changed files with 20 additions and 1 deletions
18
grammar.go
18
grammar.go
|
|
@ -600,6 +600,9 @@ func looksLikeFrenchPlural(word string) bool {
|
|||
return false
|
||||
}
|
||||
lower := core.Lower(trimmed)
|
||||
if isFrenchAspiratedHWord(lower) {
|
||||
return false
|
||||
}
|
||||
if core.HasSuffix(lower, "aux") || core.HasSuffix(lower, "eaux") {
|
||||
return true
|
||||
}
|
||||
|
|
@ -607,10 +610,14 @@ func looksLikeFrenchPlural(word string) bool {
|
|||
}
|
||||
|
||||
func startsWithVowelSound(word string) bool {
|
||||
lower := core.Lower(core.Trim(word))
|
||||
trimmed := core.Trim(word)
|
||||
lower := core.Lower(trimmed)
|
||||
if lower == "" {
|
||||
return false
|
||||
}
|
||||
if isFrenchAspiratedHWord(lower) {
|
||||
return false
|
||||
}
|
||||
r := []rune(lower)
|
||||
switch r[0] {
|
||||
case 'a', 'e', 'i', 'o', 'u', 'y',
|
||||
|
|
@ -621,6 +628,15 @@ func startsWithVowelSound(word string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func isFrenchAspiratedHWord(word string) bool {
|
||||
switch word {
|
||||
case "haricot", "héron", "héros", "honte", "hache", "hasard", "hibou", "houx", "hurluberlu":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func isFrenchLanguage(lang string) bool {
|
||||
lang = core.Lower(lang)
|
||||
return lang == "fr" || core.HasPrefix(lang, "fr-")
|
||||
|
|
|
|||
|
|
@ -377,6 +377,7 @@ func TestArticleFrenchElisionKeepsLeadingConsonant(t *testing.T) {
|
|||
"amie": {One: "amie", Other: "amies", Gender: "f"},
|
||||
"accord": {One: "accord", Other: "accords", Gender: "d"},
|
||||
"homme": {One: "homme", Other: "hommes", Gender: "m"},
|
||||
"héros": {One: "héros", Other: "héros", Gender: "m"},
|
||||
"idole": {One: "idole", Other: "idoles", Gender: "j"},
|
||||
},
|
||||
Articles: ArticleForms{
|
||||
|
|
@ -397,6 +398,7 @@ func TestArticleFrenchElisionKeepsLeadingConsonant(t *testing.T) {
|
|||
want string
|
||||
}{
|
||||
{"homme", "l'"},
|
||||
{"héros", "le"},
|
||||
{"amie", "l'"},
|
||||
{"accord", "d'"},
|
||||
{"idole", "j'"},
|
||||
|
|
@ -643,6 +645,7 @@ func TestDefinitePhraseFrenchLocale(t *testing.T) {
|
|||
{"amis", "les amis"},
|
||||
{"enfant", "l'enfant"},
|
||||
{"fichier", "le fichier"},
|
||||
{"héros", "le héros"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue