Align prompts and strengthen validation context
This commit is contained in:
@@ -186,3 +186,22 @@ func validateCapitalizationTransitions(beforeByID, afterByID map[int][]protected
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// preservesRepeatedIdentities permits a spoken-word proposal to reduce repeated
|
||||
// mentions, but not remove an identity or replace its surviving spelling.
|
||||
// Editorial and meaning validators still decide whether the cleanup is warranted.
|
||||
func (v ProtectedVocabulary) preservesRepeatedIdentities(before, after string) bool {
|
||||
original := v.occurrencesByIdentity(before)
|
||||
result := v.occurrencesByIdentity(after)
|
||||
reduced := false
|
||||
for identity, occurrences := range original {
|
||||
remaining := result[identity]
|
||||
if len(remaining) == 0 {
|
||||
return false
|
||||
}
|
||||
if len(remaining) < len(occurrences) {
|
||||
reduced = true
|
||||
}
|
||||
}
|
||||
return reduced && validateCapitalizationTransitions(original, result) == ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user