Skip to content

Commit

Permalink
imp - Source word now has a meaning
Browse files Browse the repository at this point in the history
---

The source word in the profanity info class now has a meaning.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Apr 8, 2024
1 parent e5fe3ca commit 674790c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Textify/Words/Profanity/ProfanityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public static ProfanityOccurrenceInfo[] GetProfanities(string sentence, Profanit
if (knownWords.Any((knownWord) => word.Equals(knownWord, StringComparison.OrdinalIgnoreCase)))
continue;
}
var info = new ProfanityOccurrenceInfo(searchType, match.Value, match.Value);
string source = sentence.GetEnclosedWordFromIndex(match.Index);
var info = new ProfanityOccurrenceInfo(searchType, match.Value, source.Length < 2 ? match.Value : source);
occurrences.Add(info);
}
return [.. occurrences];
Expand Down

0 comments on commit 674790c

Please sign in to comment.