fuzzy

Privateunrated

Content

149 lines
{=(COMMENT):Input management. Sets it to lowercase and stores the first argument in a variable to reuse later.}
{=(largs):{lower:{args(1):(}}}

{=(COMMENT):Fallback/error word to return when unmatched. Better if capitalized, as what we check for is lowercase, so an uppercase word will always be manually and explicitly returned (like "null" in JS, basically).}
{=(fb):NO}

{=(COMMENT):List of available words to be matched against. Leave the last two as the fallback word/call and a placeholder word!
It allows to return the fallback word when the -1 element is returned from a substring check that didn't match.}
{=(words):short test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test {fb} PLACEHOLDER}

{=(COMMENT):Blocks and values aliases, to shorten the typing of reused content in the long run.}
{=(r):replace}
{=(i):index}
{=(t):true}
{=(f):false}

{=(COMMENT):Search Term "st"}
{=(st):{{r}( ,_):{join( ):{largs}}}}

{=(COMMENT):Returns "true" if the argument is in our list of words as substring directly.}
{=(isMatchedDirectly):{in({st}):{words}}}

{=(p1):60}
{=(p2):{m:trunc({p1}*2)}}
{=(p3):{m:trunc({p2}*3)}}

{=(COMMENT):Returns our fallback word if the argument isn't in our list of words.}
{=(rep):{{r}({st},. {st} .):{words(+60)}}}
{=(matched):{{r}({t},{words({{i}({st}):{rep}})}):{{r}({f},{fb}):{isMatchedDirectly}}}}

{=(COMMENT):Adds a space between every character in the argument.}
{=(sp):{{r}(, ):{st}}}
{=(COMMENT):Removes the leading and trailing space added from the character spacing, as well as the *last* character, since we already checked if the full word is in our list of words. If we kept the last character, then we would proceed an extra substring check on the full word, which is useless.}
{=(sp):{sp(2+)}}
{=(sp):{sp(+-2)}}

{=(COMMENT):Parsing different parts (every N words) of words, to reuse at every substring check.}
{=(parseEvery):20}
{=(w1):{words(+{parseEvery})}}

{=(w2):{words({m:trunc({parseEvery}+1)}+)}}
{=(w2):{w2(+{m:trunc({parseEvery}*2)}}}

{=(w3):{words({m:trunc({parseEvery}*2+1)}+)}}
{=(w3):{w3(+{m:trunc({parseEvery}*3)}}}

{=(parsed):{join():{sp(+20)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(COMMENT):As a good starting point, start the substring check until the 20th character max.
If extended, will need to be put above the line below.}
{=(parsed):{join():{sp(+20)}}}
{=(COMMENT):If the word up until the 20th character (minus the last one) is matched, then return it, otherwise return the fallback word.}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+19)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+18)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+17)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+16)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+15)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+14)}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{{r}({parsed},. {parsed} .):{words}}})}):{matched}}}

{=(parsed):{join():{sp(+13)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+12)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+11)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+10)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+9)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+8)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+7)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+6)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+5)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+4)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+3)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(parsed):{join():{sp(+2)}}}
{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}

{=(COMMENT):Proceeds the substring check up until the very first character.
"matched" will return the fallback word if after all the checks, no word could be found, otherwise the actual matched word in our list of words.
From here, do what you need with the value of "matched". You could return an error message if no match, or call a specific variable, or anything really.}
{=(parsed):{join():{sp(+1)}}}
{=(matched):{{r}({fb},{words({{i}({parsed}):{{r}({parsed},. {parsed} .):{words}}})}):{matched}}}

{=(debug):__Debug:__
Input: `{st}`

Words: `{words}`

isMatchedDirectly: `{isMatchedDirectly}`

Spaced Input without the last character:
`{sp}`

Final matched word:
`{matched}`
}

{debug}
Raw JSON
{
  "id": 1141839,
  "created_at": "2021-11-07T13:52:33.000Z",
  "tag_name": "fuzzy",
  "nsfw": false,
  "owner_id": "149926720114262016",
  "uses": 53,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "314660900302749696",
  "sharer": "149926720114262016",
  "content": "{=(COMMENT):Input management. Sets it to lowercase and stores the first argument in a variable to reuse later.}\n{=(largs):{lower:{args(1):(}}}\n\n{=(COMMENT):Fallback/error word to return when unmatched. Better if capitalized, as what we check for is lowercase, so an uppercase word will always be manually and explicitly returned (like \"null\" in JS, basically).}\n{=(fb):NO}\n\n{=(COMMENT):List of available words to be matched against. Leave the last two as the fallback word/call and a placeholder word!\nIt allows to return the fallback word when the -1 element is returned from a substring check that didn't match.}\n{=(words):short test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test {fb} PLACEHOLDER}\n\n{=(COMMENT):Blocks and values aliases, to shorten the typing of reused content in the long run.}\n{=(r):replace}\n{=(i):index}\n{=(t):true}\n{=(f):false}\n\n{=(COMMENT):Search Term \"st\"}\n{=(st):{{r}( ,_):{join( ):{largs}}}}\n\n{=(COMMENT):Returns \"true\" if the argument is in our list of words as substring directly.}\n{=(isMatchedDirectly):{in({st}):{words}}}\n\n{=(p1):60}\n{=(p2):{m:trunc({p1}*2)}}\n{=(p3):{m:trunc({p2}*3)}}\n\n{=(COMMENT):Returns our fallback word if the argument isn't in our list of words.}\n{=(rep):{{r}({st},. {st} .):{words(+60)}}}\n{=(matched):{{r}({t},{words({{i}({st}):{rep}})}):{{r}({f},{fb}):{isMatchedDirectly}}}}\n\n{=(COMMENT):Adds a space between every character in the argument.}\n{=(sp):{{r}(, ):{st}}}\n{=(COMMENT):Removes the leading and trailing space added from the character spacing, as well as the *last* character, since we already checked if the full word is in our list of words. If we kept the last character, then we would proceed an extra substring check on the full word, which is useless.}\n{=(sp):{sp(2+)}}\n{=(sp):{sp(+-2)}}\n\n{=(COMMENT):Parsing different parts (every N words) of words, to reuse at every substring check.}\n{=(parseEvery):20}\n{=(w1):{words(+{parseEvery})}}\n\n{=(w2):{words({m:trunc({parseEvery}+1)}+)}}\n{=(w2):{w2(+{m:trunc({parseEvery}*2)}}}\n\n{=(w3):{words({m:trunc({parseEvery}*2+1)}+)}}\n{=(w3):{w3(+{m:trunc({parseEvery}*3)}}}\n\n{=(parsed):{join():{sp(+20)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(COMMENT):As a good starting point, start the substring check until the 20th character max.\nIf extended, will need to be put above the line below.}\n{=(parsed):{join():{sp(+20)}}}\n{=(COMMENT):If the word up until the 20th character (minus the last one) is matched, then return it, otherwise return the fallback word.}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+19)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+18)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+17)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+16)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+15)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+14)}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{{r}({parsed},. {parsed} .):{words}}})}):{matched}}}\n\n{=(parsed):{join():{sp(+13)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+12)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+11)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+10)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+9)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+8)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+7)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+6)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+5)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+4)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+3)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(parsed):{join():{sp(+2)}}}\n{=(replaced):{{r}({parsed},. {parsed} .):{w1}} {{r}({parsed},. {parsed} .):{w2}} {{r}({parsed},. {parsed} .):{w3}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{replaced}})}):{matched}}}\n\n{=(COMMENT):Proceeds the substring check up until the very first character.\n\"matched\" will return the fallback word if after all the checks, no word could be found, otherwise the actual matched word in our list of words.\nFrom here, do what you need with the value of \"matched\". You could return an error message if no match, or call a specific variable, or anything really.}\n{=(parsed):{join():{sp(+1)}}}\n{=(matched):{{r}({fb},{words({{i}({parsed}):{{r}({parsed},. {parsed} .):{words}}})}):{matched}}}\n\n{=(debug):__Debug:__\nInput: `{st}`\n\nWords: `{words}`\n\nisMatchedDirectly: `{isMatchedDirectly}`\n\nSpaced Input without the last character:\n`{sp}`\n\nFinal matched word:\n`{matched}`\n}\n\n{debug}",
  "embed": "{}",
  "last_fetched": "2026-10-20T17:58:30.670Z"
}