Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.44 KB

File metadata and controls

43 lines (28 loc) · 1.44 KB

obscenity


obscenity / skipNonAlphabeticTransformer

Function: skipNonAlphabeticTransformer()

skipNonAlphabeticTransformer(): SimpleTransformerContainer

Defined in: src/transformer/skip-non-alphabetic/index.ts:31

Creates a transformer that skips non-alphabetic characters (a-z, A-Z). This is useful when matching text on patterns that are solely comprised of alphabetic characters (the pattern hello does not match h.e.l.l.o by default, but does with this transformer).

Warning

This transformation is not part of the default set of transformations, as there are some known rough edges with false negatives; see #23 and #46 on the GitHub issue tracker.

Application order

It is recommended that this transformer be applied near the end of the transformer chain, if at all.

Returns

SimpleTransformerContainer

A container holding the transformer, which can then be passed to the [[RegExpMatcher]].

Example

const transformer = skipNonAlphabeticTransformer();
const matcher = new RegExpMatcher({ ..., blacklistMatcherTransformers: [transformer] });