diff --git a/Content.Server/Speech/EntitySystems/SpanishAccentSystem.cs b/Content.Server/Speech/EntitySystems/SpanishAccentSystem.cs index b2c3b4eea4..e68d23a190 100644 --- a/Content.Server/Speech/EntitySystems/SpanishAccentSystem.cs +++ b/Content.Server/Speech/EntitySystems/SpanishAccentSystem.cs @@ -1,3 +1,4 @@ +using System.Text.RegularExpressions; using System.Text; using Content.Server.Speech.Components; using Content.Shared.Speech.EntitySystems; @@ -6,9 +7,17 @@ namespace Content.Server.Speech.EntitySystems; public sealed class SpanishAccentSystem : RelayAccentSystem { + // for words in all lowercase (multiple "s" are allowed) + private static readonly Regex RegexLower = new(@"(? Estation; Capital "S" Is Replaced Directly, Multiple "S" Are Allowed) + private static readonly Regex RegexCaps = new(@"(?? ent = null) { - // Insert E before every S + // Insert E before every S that is followed by a consonant that makes a distinct sound + // (H is excluded because [sh] is a single sound) message = InsertS(message); // If a sentence ends with ?, insert a reverse ? at the beginning of the sentence message = ReplacePunctuation(message); @@ -17,20 +26,11 @@ public sealed class SpanishAccentSystem : RelayAccentSystem