Deduplicate before sorting a line list
Normalize case only when appropriate, remove duplicates, then send the retained lines to Text Sorter.
- Keep an untouched copy with the original line order
- Normalize case, Unicode, or surrounding spaces only when those differences are intentionally irrelevant
- Remove exact duplicates and verify the first occurrence of each retained line
- Send the unique result to Text Sorter only after provenance is no longer needed