Skip to content

Instantly share code, notes, and snippets.

@CIAvash
Last active August 29, 2023 06:15
Show Gist options
  • Save CIAvash/a9415f910425c0435f50769a78e5ff28 to your computer and use it in GitHub Desktop.
Save CIAvash/a9415f910425c0435f50769a78e5ff28 to your computer and use it in GitHub Desktop.
my @symbols_to_remove = Q:w「- _ ! , : / ( ) [ ] . ' + ? = * \ " # $ % & { } | ; ~ \ < > @ ` ^」;
my @terms_to_ignore = <for and the with from that your git bin this not svn who can you like into all more one any
over non them are very when about yet many its also most lets just>;
my &sanitize = *.trans(@symbols_to_remove => ' ').lc.words.grep(
{ .chars ≥ 3 and not /^ <[0..9]>+ $/ and /^ <[a..z] + [0..9]>+ $/ }
).grep(none @terms_to_ignore).unique;
say sanitize "The.quick 'brown' 🦊 jumps-OvER th 1337 QUICK <dog>!";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment