Skip to content

Commit

Permalink
chore(release): 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jo3-l committed Jan 5, 2024
1 parent 5bb1ef1 commit 3c58e14
Show file tree
Hide file tree
Showing 21 changed files with 105 additions and 79 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.2.0](https://github.com/jo3-l/obscenity/compare/v0.1.4...v0.2.0) (2024-01-05)


### ⚠ BREAKING CHANGES

* **english-preset:** Using the default English preset, Obscenity will no longer strip non-alphabetic characters from the input text before matching.

This addresses a class of egregious false negatives in previous versions (see #23), but introduces a regression where cases such as 'f u c k' (with the space) will no longer be detected by default. We expect to provide a more comprehensive fix in the next minor release.

If desired, it remains possible to revert to the previous behavior by providing a custom set of transformers to the matcher.
* **matchers:** The NfaMatcher class has been removed. Use the RegExpMatcher instead.

### Features

* **english-preset:** blacklist 'shit' by default ([b0d90aa](https://github.com/jo3-l/obscenity/commit/b0d90aa4b7dd6d15a2105490f1d2b0c87e58bdcf)), closes [#47](https://github.com/jo3-l/obscenity/issues/47)


### Bug Fixes

* **english-preset:** don't include skip-non-alphabetic transformer ([620c721](https://github.com/jo3-l/obscenity/commit/620c721662c3ddd8d8ca8838861b9c4ba3ea66e7)), closes [#23](https://github.com/jo3-l/obscenity/issues/23) [#46](https://github.com/jo3-l/obscenity/issues/46)
* **english-preset:** remove extraneous patterns for n-word ([e135be5](https://github.com/jo3-l/obscenity/commit/e135be58510149db9b678801a2e6e3468b3bd4bb)), closes [#48](https://github.com/jo3-l/obscenity/issues/48)
* **pkg:** ensure types resolve in ESM ([718da8a](https://github.com/jo3-l/obscenity/commit/718da8a7399c0dcf948fbe8041714ad6d61c9f73)), closes [#44](https://github.com/jo3-l/obscenity/issues/44)


* **matchers:** remove NfaMatcher ([b69c21d](https://github.com/jo3-l/obscenity/commit/b69c21d178ac5e3270fd35d2b876263045a67d81))

### [0.1.4](https://github.com/jo3-l/obscenity/compare/v0.1.1...v0.1.4) (2023-06-06)

### Bug Fixes
Expand Down
56 changes: 28 additions & 28 deletions docs/reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Context passed to [[TextCensorStrategy | text censoring strategies]].

#### Defined in

[src/censor/TextCensor.ts:104](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/TextCensor.ts#L104)
[src/censor/TextCensor.ts:104](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/TextCensor.ts#L104)

___

Expand All @@ -92,7 +92,7 @@ should be a set of characters that map to the transformed character.

#### Defined in

[src/transformer/remap-characters/index.ts:60](https://github.com/jo3-l/obscenity/blob/0b48eca/src/transformer/remap-characters/index.ts#L60)
[src/transformer/remap-characters/index.ts:60](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/transformer/remap-characters/index.ts#L60)

___

Expand All @@ -104,7 +104,7 @@ All the profane words that are included in the [[englishDataset | english datase

#### Defined in

[src/preset/english.ts:383](https://github.com/jo3-l/obscenity/blob/0b48eca/src/preset/english.ts#L383)
[src/preset/english.ts:383](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/preset/english.ts#L383)

___

Expand All @@ -122,7 +122,7 @@ Extends the default match payload by adding phrase metadata.

#### Defined in

[src/dataset/DataSet.ts:190](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L190)
[src/dataset/DataSet.ts:190](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L190)

___

Expand All @@ -134,7 +134,7 @@ All the possible kinds of nodes.

#### Defined in

[src/pattern/Nodes.ts:24](https://github.com/jo3-l/obscenity/blob/0b48eca/src/pattern/Nodes.ts#L24)
[src/pattern/Nodes.ts:24](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/pattern/Nodes.ts#L24)

___

Expand All @@ -161,7 +161,7 @@ replacement string.

#### Defined in

[src/censor/TextCensor.ts:99](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/TextCensor.ts#L99)
[src/censor/TextCensor.ts:99](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/TextCensor.ts#L99)

## Variables

Expand Down Expand Up @@ -222,7 +222,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#### Defined in

[src/preset/english.ts:103](https://github.com/jo3-l/obscenity/blob/0b48eca/src/preset/english.ts#L103)
[src/preset/english.ts:103](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/preset/english.ts#L103)

___

Expand All @@ -235,7 +235,7 @@ A set of transformers to be used when matching blacklisted patterns with the

#### Defined in

[src/preset/english.ts:13](https://github.com/jo3-l/obscenity/blob/0b48eca/src/preset/english.ts#L13)
[src/preset/english.ts:13](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/preset/english.ts#L13)

___

Expand All @@ -248,7 +248,7 @@ dataset]] and the [[RegExpMatcher]].

#### Defined in

[src/preset/english.ts:48](https://github.com/jo3-l/obscenity/blob/0b48eca/src/preset/english.ts#L48)
[src/preset/english.ts:48](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/preset/english.ts#L48)

___

Expand All @@ -261,7 +261,7 @@ A set of transformers to be used when matching whitelisted terms with the

#### Defined in

[src/preset/english.ts:36](https://github.com/jo3-l/obscenity/blob/0b48eca/src/preset/english.ts#L36)
[src/preset/english.ts:36](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/preset/english.ts#L36)

___

Expand All @@ -273,7 +273,7 @@ The current version of the library, formatted as `MAJOR.MINOR.PATCH`.

#### Defined in

[src/index.ts:27](https://github.com/jo3-l/obscenity/blob/0b48eca/src/index.ts#L27)
[src/index.ts:27](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/index.ts#L27)

## Functions

Expand Down Expand Up @@ -312,7 +312,7 @@ to the [[RegExpMatcher]].

#### Defined in

[src/matcher/BlacklistedTerm.ts:37](https://github.com/jo3-l/obscenity/blob/0b48eca/src/matcher/BlacklistedTerm.ts#L37)
[src/matcher/BlacklistedTerm.ts:37](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/matcher/BlacklistedTerm.ts#L37)

___

Expand All @@ -339,7 +339,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:71](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/BuiltinStrategies.ts#L71)
[src/censor/BuiltinStrategies.ts:71](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/BuiltinStrategies.ts#L71)

___

Expand Down Expand Up @@ -402,7 +402,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/collapse-duplicates/index.ts:46](https://github.com/jo3-l/obscenity/blob/0b48eca/src/transformer/collapse-duplicates/index.ts#L46)
[src/transformer/collapse-duplicates/index.ts:46](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/transformer/collapse-duplicates/index.ts#L46)

___

Expand Down Expand Up @@ -443,7 +443,7 @@ than the first.

#### Defined in

[src/matcher/MatchPayload.ts:57](https://github.com/jo3-l/obscenity/blob/0b48eca/src/matcher/MatchPayload.ts#L57)
[src/matcher/MatchPayload.ts:57](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/matcher/MatchPayload.ts#L57)

___

Expand Down Expand Up @@ -477,7 +477,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:134](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/BuiltinStrategies.ts#L134)
[src/censor/BuiltinStrategies.ts:134](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/BuiltinStrategies.ts#L134)

___

Expand Down Expand Up @@ -521,7 +521,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:115](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/BuiltinStrategies.ts#L115)
[src/censor/BuiltinStrategies.ts:115](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/BuiltinStrategies.ts#L115)

___

Expand Down Expand Up @@ -550,7 +550,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:89](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/BuiltinStrategies.ts#L89)
[src/censor/BuiltinStrategies.ts:89](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/BuiltinStrategies.ts#L89)

___

Expand Down Expand Up @@ -584,7 +584,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:51](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/BuiltinStrategies.ts#L51)
[src/censor/BuiltinStrategies.ts:51](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/BuiltinStrategies.ts#L51)

___

Expand Down Expand Up @@ -629,7 +629,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:28](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/BuiltinStrategies.ts#L28)
[src/censor/BuiltinStrategies.ts:28](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/BuiltinStrategies.ts#L28)

___

Expand Down Expand Up @@ -664,7 +664,7 @@ The parsed pattern, which can then be used with the

#### Defined in

[src/pattern/Pattern.ts:130](https://github.com/jo3-l/obscenity/blob/0b48eca/src/pattern/Pattern.ts#L130)
[src/pattern/Pattern.ts:130](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/pattern/Pattern.ts#L130)

___

Expand Down Expand Up @@ -797,7 +797,7 @@ The parsed pattern, which can then be used with the

#### Defined in

[src/pattern/Pattern.ts:106](https://github.com/jo3-l/obscenity/blob/0b48eca/src/pattern/Pattern.ts#L106)
[src/pattern/Pattern.ts:106](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/pattern/Pattern.ts#L106)

___

Expand Down Expand Up @@ -831,7 +831,7 @@ A [[TextCensorStrategy]] for use with the [[TextCensor]].

#### Defined in

[src/censor/BuiltinStrategies.ts:155](https://github.com/jo3-l/obscenity/blob/0b48eca/src/censor/BuiltinStrategies.ts#L155)
[src/censor/BuiltinStrategies.ts:155](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/censor/BuiltinStrategies.ts#L155)

___

Expand Down Expand Up @@ -891,7 +891,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/remap-characters/index.ts:38](https://github.com/jo3-l/obscenity/blob/0b48eca/src/transformer/remap-characters/index.ts#L38)
[src/transformer/remap-characters/index.ts:38](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/transformer/remap-characters/index.ts#L38)

___

Expand Down Expand Up @@ -924,7 +924,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/resolve-confusables/index.ts:22](https://github.com/jo3-l/obscenity/blob/0b48eca/src/transformer/resolve-confusables/index.ts#L22)
[src/transformer/resolve-confusables/index.ts:22](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/transformer/resolve-confusables/index.ts#L22)

___

Expand Down Expand Up @@ -958,7 +958,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/resolve-leetspeak/index.ts:23](https://github.com/jo3-l/obscenity/blob/0b48eca/src/transformer/resolve-leetspeak/index.ts#L23)
[src/transformer/resolve-leetspeak/index.ts:23](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/transformer/resolve-leetspeak/index.ts#L23)

___

Expand Down Expand Up @@ -1000,7 +1000,7 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/skip-non-alphabetic/index.ts:31](https://github.com/jo3-l/obscenity/blob/0b48eca/src/transformer/skip-non-alphabetic/index.ts#L31)
[src/transformer/skip-non-alphabetic/index.ts:31](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/transformer/skip-non-alphabetic/index.ts#L31)

___

Expand All @@ -1027,4 +1027,4 @@ A container holding the transformer, which can then be passed to the

#### Defined in

[src/transformer/to-ascii-lowercase/index.ts:18](https://github.com/jo3-l/obscenity/blob/0b48eca/src/transformer/to-ascii-lowercase/index.ts#L18)
[src/transformer/to-ascii-lowercase/index.ts:18](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/transformer/to-ascii-lowercase/index.ts#L18)
10 changes: 5 additions & 5 deletions docs/reference/classes/DataSet.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const customDataset = new DataSet().addAll(englishDataset);

#### Defined in

[src/dataset/DataSet.ts:29](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L29)
[src/dataset/DataSet.ts:29](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L29)

___

Expand Down Expand Up @@ -96,7 +96,7 @@ const data = new DataSet<{ originalWord: string }>()

#### Defined in

[src/dataset/DataSet.ts:75](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L75)
[src/dataset/DataSet.ts:75](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L75)

___

Expand All @@ -122,7 +122,7 @@ const matcher = new RegExpMatcher({

#### Defined in

[src/dataset/DataSet.ts:118](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L118)
[src/dataset/DataSet.ts:118](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L118)

___

Expand Down Expand Up @@ -154,7 +154,7 @@ const phraseMetadata = matchesWithPhraseMetadata[0].phraseMetadata;

#### Defined in

[src/dataset/DataSet.ts:94](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L94)
[src/dataset/DataSet.ts:94](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L94)

___

Expand Down Expand Up @@ -184,4 +184,4 @@ const customDataset = new DataSet<{ originalWord: string }>()

#### Defined in

[src/dataset/DataSet.ts:46](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L46)
[src/dataset/DataSet.ts:46](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L46)
8 changes: 4 additions & 4 deletions docs/reference/classes/ParserError.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Error.constructor

#### Defined in

[src/pattern/ParserError.ts:18](https://github.com/jo3-l/obscenity/blob/0b48eca/src/pattern/ParserError.ts#L18)
[src/pattern/ParserError.ts:18](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/pattern/ParserError.ts#L18)

## Properties

Expand All @@ -57,7 +57,7 @@ Note that surrogate pairs are counted as 1 column wide, not 2.

#### Defined in

[src/pattern/ParserError.ts:16](https://github.com/jo3-l/obscenity/blob/0b48eca/src/pattern/ParserError.ts#L16)
[src/pattern/ParserError.ts:16](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/pattern/ParserError.ts#L16)

___

Expand All @@ -69,7 +69,7 @@ The line on which the error occurred (one-based).

#### Defined in

[src/pattern/ParserError.ts:10](https://github.com/jo3-l/obscenity/blob/0b48eca/src/pattern/ParserError.ts#L10)
[src/pattern/ParserError.ts:10](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/pattern/ParserError.ts#L10)

___

Expand Down Expand Up @@ -97,7 +97,7 @@ Error.name

#### Defined in

[src/pattern/ParserError.ts:5](https://github.com/jo3-l/obscenity/blob/0b48eca/src/pattern/ParserError.ts#L5)
[src/pattern/ParserError.ts:5](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/pattern/ParserError.ts#L5)

___

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/classes/PhraseBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Associates a pattern with this phrase.

#### Defined in

[src/dataset/DataSet.ts:149](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L149)
[src/dataset/DataSet.ts:149](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L149)

___

Expand All @@ -77,7 +77,7 @@ Associates a whitelisted pattern with this phrase.

#### Defined in

[src/dataset/DataSet.ts:159](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L159)
[src/dataset/DataSet.ts:159](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L159)

___

Expand All @@ -94,7 +94,7 @@ Builds the phrase, returning a [[PhraseContainer]] for use with the

#### Defined in

[src/dataset/DataSet.ts:178](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L178)
[src/dataset/DataSet.ts:178](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L178)

___

Expand All @@ -116,4 +116,4 @@ Associates some metadata with this phrase.

#### Defined in

[src/dataset/DataSet.ts:169](https://github.com/jo3-l/obscenity/blob/0b48eca/src/dataset/DataSet.ts#L169)
[src/dataset/DataSet.ts:169](https://github.com/jo3-l/obscenity/blob/5bb1ef1/src/dataset/DataSet.ts#L169)
Loading

0 comments on commit 3c58e14

Please sign in to comment.