Full explanation of the updated LostSideDead-style overlapping-letter chain and group logic, plus the working C++ source. Copy or download the source with includes intact.
This tool detects identifiers like LostSideDead by decomposing, extracting two-letter pairs, chaining overlapping letters, and enforcing a structured non-decreasing group sequence. The output highlights:
L s S d D d) that must be non-decreasing unless disabled.Step-by-step:
LostSideDead is split into words at uppercase boundaries, preserving consecutive uppercase runs (e.g., JSONData → JSON, Data).Dead, Level), produce Upper(first)+lower(first) to surface a case-toggle, e.g., Dead → Dd, Level → Ll.Lost → Ls, Side → Sd).LSD).Ls Sd Dd → L s S d D d) and assign group numbers:
1 2 2 3 3 3 for LostSideDead) unless the group check is turned off.LostSideDeadThis shows the full breakdown: the pair from “Dead” is Dd because first and last letter match ignoring case; the flattened letters produce a non-decreasing group sequence 1 2 2 3 3 3, and both overlaps exist with case toggles flagged.
Compile:
g++ -std=c++17 -O2 -o pattern_tool_updated pattern_tool_updated.cpp
Run: Supply input via pipe or files:
echo "LostSideDead ExampleToken" | ./pattern_tool_updated
Flags:
--no-group-check — do not require the flattened group sequence to be non-decreasing; still requires at least one overlap.-h / --help — show usage.pattern_tool_updated.cpp