-1
Your challenge is to parse nonsensical text and output a "congruous phrase" - which I shall define here to be text with any contiguous characters in between, and including, a given set of like symbols removed.
The given set of like symbols (ignore all brackets and commas here, they're only for notation) are: {(< >), (^ ^), (' '), (: :), (% %)}
[NOTE: This question has been heavily refined after several critical errors were identified.]
EXAMPLE 1:
Thi'inquit Caecilius's qu % est provocationem %h^ ad howe et^s [ben] heavilede ^citi:ssim:e^< rn^> ^quolibe doetiguis^dited %inger 'ingenia'%! S__o:esse: rr %^umd^%y...
OUTPUT 1:
This qu hs [ben] heavilede dited ! S__o rr y
.
Be wary of the nested like symbol parts - e.g ^citi:ssim:e^ and < rn^> from above, where the pair : : are sandwiched between another pair ^ ^, and a half-pair ^ in between < >. Both of these non-congruous phrases must be removed.
EXAMPLE 2:
W%cd'fuf'dc%at<>ch^'o'^out!
OUTPUT 2:
Watchout!
.
EXAMPLE 3: Special Case (partial nested like symbols)
aaa^bbb%ccc'ddd^eee%ddd'fff
OUTPUT3: The first occurence of the given like symbol is the dominant; in this case ^
aaaeee%ddd'fff
The code must apply to the general case, so any text of your choosing, of length >= 30 characters, may be used as test cases.
The shortest code, in bytes, that completes this challenge successfully, is the winning code.
3Scoring on character count is a bad idea. It leads to code that's gibberish packed into multibyte characters that's decompressed and run within the program. – xnor – 2019-11-10T07:18:52.857
@JoKing I'm terribly sorry, this gibberish has been corrected; different timezone here, so I wasn't quite myself.. – john321 – 2019-11-10T10:15:38.433
@xnor Thanks for pointing that out; it has been corrected to shortest bytes – john321 – 2019-11-10T10:16:06.290
Are you meant to take those symbols as input, or are they hardcoded? – Jo King – 2019-11-10T10:23:44.237
@JoKing They're hardcoded – john321 – 2019-11-10T10:26:38.433
You say the code must apply to the general case, so what do you expect for partially overlapping like symbol pairs like
aaa^bbb<ccc^ddd>eee
, or like symbol triples likeaaa:bbb:ccc:ddd
, or more complicated cases? – Anders Kaseorg – 2019-11-10T18:31:07.830You need more test cases, clarifying "Be wary of the nested like symbol parts - e.g ^citi:ssim:e^ and < rn^>" – HiddenBabel – 2019-11-10T18:59:30.893
@AndersKaseorg Nice observation; in such special cases, the first like symbol to appear is the dominant one; see EXAMPLE 3 edit – john321 – 2019-11-10T19:39:35.457
@HiddenBabel Yes, I have added 2 more e.gs, involving separate special cases – john321 – 2019-11-10T19:40:30.587
1I'm voting to reopen this, but I don't think it is that interesting of a question – Jo King – 2019-11-10T23:57:36.827
1Could this be moved to the sandbox (where it probably should have started)? – ouflak – 2019-11-11T08:30:15.910