Skip to content

Commit

Permalink
fix(preset/english): add word boundary to 'shit' pattern
Browse files Browse the repository at this point in the history
The pattern `shit` was matching on names such as "harshit". Fix this
issue by adding a word boundary assertion at the start.

Thanks to @kaushal-aubie for the report.

Closes #93
  • Loading branch information
jo3-l committed Jan 18, 2025
1 parent fa673e6 commit 9554e7c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/preset/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,11 @@ export const englishDataset = new DataSet<{ originalWord: EnglishProfaneWord }>(
.addPhrase((phrase) =>
phrase
.setMetadata({ originalWord: 'shit' })
.addPattern(pattern`shit`)
.addPattern(pattern`|shit`)
.addWhitelistedTerm('s hit')
.addWhitelistedTerm('sh it')
.addWhitelistedTerm('shi t')
.addWhitelistedTerm('shitake')
.addWhitelistedTerm('mishit'),
.addWhitelistedTerm('shitake'),
)
.addPhrase((phrase) => phrase.setMetadata({ originalWord: 'slut' }).addPattern(pattern`s[s]lut`))
.addPhrase((phrase) => phrase.setMetadata({ originalWord: 'spastic' }).addPattern(pattern`|spastic`))
Expand Down

0 comments on commit 9554e7c

Please sign in to comment.